Skip to content

How to access the context variable in a graph_multi_asset #21018

Answered by garethbrickman
pbower asked this question in Q&A
Discussion options

You must be logged in to vote

In Dagster, the context parameter is used to pass execution-time information to assets and ops. However, when defining a graph_multi_asset, you cannot directly use context as a parameter name because it is a reserved keyword in Dagster. This is why you are encountering the DagsterInvalidDefinitionError.

To access context metadata within a graph_multi_asset, you should use the parameters that are passed to the underlying ops or assets. These parameters can include the partition key or other context-related information that you need.

If you need to access the partition key within a graph_multi_asset, you would typically do so within the individual ops that make up the graph, rather than at …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@pbower
Comment options

@garethbrickman
Comment options

Answer selected by pbower
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
type: troubleshooting Related to debugging and error messages area: partitions Related to Partitions
2 participants