How can I access a tag run tag in an asset? #19630
liamwazherealso
started this conversation in
Community
Replies: 1 comment
-
Well, i didn't quite understand your logic of allowing downstream assets to materialize, but if you would like to access tags within the asset, you can use the following way. def my_asset(context: AssetExecutionContext):
# to see the current runtags associated with this run
context.run_tags
# to add more run tags during the materialization of the asset
context.instance.add_run_tags(context.run_id, {'my_tag': True})
# use metadata to add associated tags
context.add_output_metadata({'my_tag': True}, output_name='result') The first one gives you the run tags. Second makes you add additional tags. Third, is optional to updating tags, you can use output metadata to store values. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently I have an asset of the following form
That once materialized allows downstream auto-materialized assets to run. Issue is that once this is triggered it will be valid until the next day occurs.
I'd like to be able to pass a bool argument to the asset that is the value of the asset. I was thinking of using tags to do this, unsure how I can access from within the asset code?
Beta Was this translation helpful? Give feedback.
All reactions