Skip to content

How do you access the definition metadata for an upstream asset? #21830

Discussion options

You must be logged in to vote

Definition-level metadata is typically meant for showing in the UI in a current context. So it's not automatically persisted on historical materialization events. Nevertheless, you can access it in a downstream asset by importing the asset's definition (defs):

@asset(deps=["usptream"])
def downstream():
    from top_level_module import defs

    upstream_metadata = defs.get_asset_graph().get(AssetKey("upstream")).metadata

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jonathanbhaskar
Comment options

Answer selected by jonathanbhaskar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
area: asset Related to Software-Defined Assets
2 participants