Skip to content

Comments

fix(taskinstnace): set internal asset_type of all Asset subclass to "Asset"#47598

Closed
Lee-W wants to merge 4 commits intoapache:mainfrom
astronomer:correctly-handle-asset-type
Closed

fix(taskinstnace): set internal asset_type of all Asset subclass to "Asset"#47598
Lee-W wants to merge 4 commits intoapache:mainfrom
astronomer:correctly-handle-asset-type

Conversation

@Lee-W
Copy link
Member

@Lee-W Lee-W commented Mar 11, 2025

It's a temporary, unclean workaround and should be reworked later, but it can solve the current bug

Why

Currently, asset_type decides how we register asset events.
(Note that the asset_type here is asset object type (e.g., Asset, AssetAlias) instead of Asset.asset_type)
As Asset might be subclassed, all instances of Asset subclasses should have "Asset" as their asset_type.

What

If the object is an instance of Asset, set the asset_type (the one we use to decide how we register asset events) to "Asset"


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Currently, asset_type is used to decide how we register asset event.
(note that the asset_type here is object type instead of Asset.asset_type)
As Asset might be subclass, all instances of Asset subclasses should have "Asset" as their asset_type
@Lee-W Lee-W changed the title fix(taskinstnace): set the asset_type of all Asset subclass to "Asset" fix(taskinstnace): set asset_type of all Asset subclass to "Asset" Mar 11, 2025
@Lee-W Lee-W force-pushed the correctly-handle-asset-type branch from 41d56c8 to c298093 Compare March 11, 2025 07:55
@uranusjr uranusjr self-assigned this Mar 12, 2025
@Lee-W Lee-W changed the title fix(taskinstnace): set asset_type of all Asset subclass to "Asset" fix(taskinstnace): set internal asset_type of all Asset subclass to "Asset" Mar 12, 2025
@Lee-W Lee-W marked this pull request as ready for review March 12, 2025 05:19
@Lee-W Lee-W requested review from XD-DENG and ashb as code owners March 12, 2025 05:20
@Lee-W
Copy link
Member Author

Lee-W commented Mar 12, 2025

close it in favor of #47659

@Lee-W Lee-W closed this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants