Skip to content

Implement Asset.ref for name or URI references#45028

Merged
uranusjr merged 5 commits intoapache:mainfrom
astronomer:asset-schedule
Dec 26, 2024
Merged

Implement Asset.ref for name or URI references#45028
uranusjr merged 5 commits intoapache:mainfrom
astronomer:asset-schedule

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
HariGS-DB pushed a commit to HariGS-DB/airflow that referenced this pull request Jan 16, 2025
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
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