-
Given an ObservableSourceAsset and a downstream asset, how do I get the dataversion associated with the source asset in downstream asset? |
Beta Was this translation helpful? Give feedback.
Answered by
sryza
Jun 9, 2023
Replies: 1 comment 3 replies
-
from dagster import asset, observable_source_asset, DataVersion
@observable_source_asset
def asset1():
return DataVersion("5")
@asset(non_argument_deps={"asset1"})
def asset2(context):
latest_materialization_event = context.get_step_execution_context().get_input_asset_record(asset1.key).event_log_entry
upstream_data_version = latest_materialization_event.tags.get("dagster/data_version") This should also work if the upstream asset is a regular materializable asset instead of an observable source asset. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
sryza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should also work if the upstream asset is a regular materializable asset instead of an observable source asset.