question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build_hook_context does not support ctx.solid, ctx.solid_config and other properties.

See original GitHub issue

Use Case

Currently, if a HookContext is created using build_hook_context, it will not have a bunch of properties and will instead raise a DagsterInvalidPropertyError as implemented in https://github.com/dagster-io/dagster/blob/b0c430857c1d772be76216164858ddc7babe376d/python_modules/dagster/dagster/core/execution/context/hook.py#L182

Currently, there is no way to provide a Solid instance or any of the other properties. This makes it impossible to test hooks that need access to context.solid and other properties.

Ideas of Implementation

One way would be to change build_hook_context to support more kwargs so that the other properties may be specified.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
dpeng817commented, Aug 5, 2021

not quite completed yet. While solid is now supported, there are a few other top level args we should support, namely solid_config, pipeline_name, run_id, and solid_exception.

I can get to that this week.

2reactions
dpeng817commented, Nov 19, 2021

Hello @LouisAuneau ! There’s a PR up to resolve this now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found