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

Fix warning when using xcomarg dependencies #26801

Merged

Conversation

ashb
Copy link
Member

@ashb ashb commented Sep 30, 2022

This warning was invisible before 2.4 due to a bug in our logging config (fixed by commit 7363e35) and AIP-45 which suddenly made this appear.

The problem was being caused by set_xcomargs_dependencies being called once for each class in the hierarchy, and each of them doing the same logic.

The fix is to look at the actual function of self.__init__ and compare it to the function we're about to call so that we don't set dependencies until we have finished the "outer" most class's apply_defaults invocation.

This warning was invisible before 2.4 due to a bug in our logging config
(fixed by commit 7363e35) and AIP-45 which suddenly made this appear.

The problem was being caused by set_xcomargs_dependencies being called
once for each class in the hierarchy, and each of them doing the same
logic.

The fix is to look at the _actual_ function of `self.__init__` and
compare it to the function we're about to call so that we don't set
dependencies until we have finished the "outer" most class's
apply_defaults invocation.
@ashb ashb requested a review from uranusjr as a code owner September 30, 2022 13:16
@ashb ashb added this to the Airflow 2.4.2 milestone Sep 30, 2022
@jedcunningham jedcunningham merged commit d77f056 into apache:main Sep 30, 2022
@jedcunningham jedcunningham deleted the remove-duplicate-xcomarg-dep-warnings branch September 30, 2022 16:03
@jedcunningham jedcunningham added the type:bug-fix Changelog: Bug Fixes label Sep 30, 2022
ephraimbuddy pushed a commit that referenced this pull request Oct 18, 2022
This warning was invisible before 2.4 due to a bug in our logging config
(fixed by commit 7363e35) and AIP-45 which suddenly made this appear.

The problem was being caused by set_xcomargs_dependencies being called
once for each class in the hierarchy, and each of them doing the same
logic.

The fix is to look at the _actual_ function of `self.__init__` and
compare it to the function we're about to call so that we don't set
dependencies until we have finished the "outer" most class's
apply_defaults invocation.

(cherry picked from commit d77f056)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug-fix Changelog: Bug Fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants