Skip to content

DagsterInvalidDefinitionError: "context" is not a valid name in Dagster. It conflicts with a Dagster or python reserved keyword #22576

Closed Answered by cmpadden
valerio-bud asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @valerio-bud - this appears to be due to the order of the arguments. I confirmed that moving the context argument before the parent_asset argument in my_asset resolves the issue.

from dagster import asset, AssetIn, AssetExecutionContext, Definitions


@asset
def parent_asset(context: AssetExecutionContext) -> None:
    return 'hi there!'


@asset(ins={'parent_asset': AssetIn('parent_asset')})
def my_asset(
    context: AssetExecutionContext,
    parent_asset: str,
) -> None:
    print(parent_asset + ' whatever')


Definitions(assets=[parent_asset, my_asset])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by cmpadden
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
2 participants