Description
Support AssetState mechanism in the Task SDK for use in things like BaseEventTrigger's, which don't have access to context.
from airflow.sdk import AssetState
asset_state = AssetState(name="my_asset") # Pass in the name of the Asset (or uri)
asset_state.set("watermark": "1") # Store a value
watermark = asset_state.get("watermark") # Retrieve the value
print(watermark) # Should output "1"
Use case/motivation
Allow for Asset State to be retrieved/set in BaseEventTrigger, useful for Asset-watching.
Related issues
PR: #66595 (comment)
Are you willing to submit a PR?
Code of Conduct
Description
Support
AssetStatemechanism in the Task SDK for use in things likeBaseEventTrigger's, which don't have access tocontext.Use case/motivation
Allow for Asset State to be retrieved/set in
BaseEventTrigger, useful for Asset-watching.Related issues
PR: #66595 (comment)
Are you willing to submit a PR?
Code of Conduct