dagster
dagster copied to clipboard
Add context method to get observable asset key
Summary
Addresses #18896. Adds a new property observable_asset_key on the OpExecutionContext which returns the asset key associated with the currently executing @observable_source_asset, if inside the body of such an asset.
Right now it's pretty cumbersome to access, users have to use the (pretty opaque) context.asset_key_for_output("result"). Not sure if this is better addressed elsewhere w/ the context reworks.
@observable_source_asset(
...
)
def source_asset_with_observer(context: OpExecutionContext):
context.log.info("Self key: %s", context.observable_asset_key)
Also tentatively updates asset_key prop to return the observable asset key.
Test Plan
New unit test.
-
#18898
👈 (View in Graphite)
-
master
This stack of pull requests is managed by Graphite. Learn more about stacking.