Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Asset.ref for name or URI references #45028

Merged
merged 5 commits into from
Dec 26, 2024

Conversation

uranusjr
Copy link
Member

This allows us to refer to an asset without needing the original object, making it easier to schedule against an asset.

I also added some minor improvements to register_asset_change so we can save a db query or the asset-model conversion in some cases.

There are a couple of possible sytax designs available:

# Magic constructor.
AssetRef(name="asset-1")
AssetRef(uri="s3://bucket/assets/1")

# Magic factory method on Asset.
Asset.ref(name="asset-1")
Asset.ref(uri="s3://bucket/assets/1")

I’m opting for the second one with a factory method since it is easier to implement, but we can discuss which one we like better.

@boring-cyborg boring-cyborg bot added area:API Airflow's REST/HTTP API area:db-migrations PRs with DB migration area:Scheduler including HA (high availability) scheduler area:serialization area:task-sdk kind:documentation labels Dec 18, 2024
@uranusjr uranusjr added AIP-75 Asset-Centric Syntax and removed area:Scheduler including HA (high availability) scheduler area:serialization area:API Airflow's REST/HTTP API kind:documentation area:db-migrations PRs with DB migration area:task-sdk labels Dec 18, 2024
@uranusjr uranusjr mentioned this pull request Dec 18, 2024
2 tasks
@uranusjr uranusjr added the legacy api Whether legacy API changes should be allowed in PR label Dec 18, 2024
@uranusjr uranusjr added area:Scheduler including HA (high availability) scheduler area:serialization area:API Airflow's REST/HTTP API kind:documentation area:task-sdk labels Dec 18, 2024
@uranusjr uranusjr force-pushed the asset-schedule branch 2 times, most recently from 1876468 to 15cffbc Compare December 18, 2024 13:56
@Lee-W Lee-W self-requested a review December 18, 2024 14:55
@uranusjr uranusjr force-pushed the asset-schedule branch 2 times, most recently from 6e82d46 to f78ec93 Compare December 24, 2024 08:21
This allows us to refer to an asset without needing the original object,
making it easier to schedule against an asset.
@uranusjr uranusjr merged commit c5d559c into apache:main Dec 26, 2024
96 checks passed
@uranusjr uranusjr deleted the asset-schedule branch December 26, 2024 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AIP-75 Asset-Centric Syntax area:API Airflow's REST/HTTP API area:Scheduler including HA (high availability) scheduler area:serialization area:task-sdk kind:documentation legacy api Whether legacy API changes should be allowed in PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants