aip-93-scoping: Adding AssetWatcher.asset functionality#65103
Draft
jroachgolf84 wants to merge 2 commits intoapache:mainfrom
Draft
aip-93-scoping: Adding AssetWatcher.asset functionality#65103jroachgolf84 wants to merge 2 commits intoapache:mainfrom
aip-93-scoping: Adding AssetWatcher.asset functionality#65103jroachgolf84 wants to merge 2 commits intoapache:mainfrom
Conversation
Collaborator
Author
|
cc: @cmarteepants, @vikramkoka |
Contributor
|
I was wondering why you want to pass the asset to the asset watcher as opposed to passing the asset watcher to the asset like today? I do not see why it makes more sense (though I have not strong opinion on which way is better). However, this will also introduce some breaking changes for the user, we would need to deprecate the existing way to define asset watcher, update documentation etc. That is why I am asking, to me, if there is no strong argument on whether this way is better, I do not think we should do that. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
With AIP-103 adding an interface to persist state for Assets, AIP-93 shifts more towards implementing a way to use this state when building
BaseEventTriggerfor "Asset-watching". Currently, any Trigger defined for "Asset watching" is Asset-unaware. This PR adds the ability to make these Trigger Asset-aware.The new pattern implemented here allows for an
Assetobject to be passed to theAssetWatcher(via thetrigger). This makes much more sense; first, I define an Asset. Then, I define a way to "watch" that Asset.The majority of these changes are setting up for AIP-103, and the ability to use an
asset_nameandasset_urito instantiate some object to retrieve and set state. The only changes that were required for the new paradigm to be enabled was the changes totask-sdk/src/airflow/sdk/definitions/asset/__init__.py, adding the asset field and adding the__attrs_post_init__toAssetWatcher.Future State
Eventually, I'd love to get to the following syntax, which is SIGNIFICANTLY more intuitive for DAG authors. This is just an example, and I'm sure the syntax would actually look a bit different.
Testing
Note, no unit tests have been implemented yet; this PR is just providing a forum for discussion. Tests will be added after discussion.
No, an LLM was not used to generate this code/create this PR.