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

Simplify asset decorator implementation #44344

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

uranusjr
Copy link
Member

Since AssetDefinition subclasses Asset, we don't really need the to_asset() method, but can just pass self in.

I also moved some imports around to reduce module loading at import time.


^ 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.

Since AssetDefinition subclasses Asset, we don't really need the
to_asset() method, but can just pass self in.

I also moved some imports around to reduce module loading at import
time.
@uranusjr uranusjr marked this pull request as ready for review November 26, 2024 07:44
@Lee-W
Copy link
Member

Lee-W commented Nov 26, 2024

overall looks good, but look like we need to update some test cases 🤔

@uranusjr
Copy link
Member Author

Actually that’s a bug in my implementation. Fixed.

attrs defaults only kick in if we don't provide a value. So we need to
be more careful not to provide a thing (instead of providing a default).
@uranusjr uranusjr merged commit f8a61cb into apache:main Nov 26, 2024
62 checks passed
@uranusjr uranusjr deleted the aset-decorator-simplify branch November 26, 2024 10:51
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.

3 participants