-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Replace usages of XCOM_RETURN_KEY in providers to not be from utils
#53170
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
Replace usages of XCOM_RETURN_KEY in providers to not be from utils
#53170
Conversation
XCOM_RETURN_KEY in providers to not be from utils
| __all__ = [ | ||
| "AIRFLOW_V_3_0_PLUS", | ||
| "AIRFLOW_V_3_0_1", | ||
| "AIRFLOW_V_3_1_PLUS", | ||
| "SQLALCHEMY_V_1_4", | ||
| "SQLALCHEMY_V_2_0", | ||
| "XCOM_RETURN_KEY", | ||
| ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding this (which is also missing the fns etc) change the import to from ... import XCOM_RETURN_KEY as XCOM_RETURN_KEY - that should remove the unused import warning
| AIRFLOW_V_3_1_PLUS = get_base_airflow_version_tuple() >= (3, 1, 0) | ||
|
|
||
| if AIRFLOW_V_3_1_PLUS: | ||
| from airflow.models.xcom import XCOM_RETURN_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're changing this, it's should be changed to use something from sdk, not core.
Also this reminds me- the airflow version check in providers needs to go soon too - we ideally want to "duck type" off what we can I the sdk (i.e. try import except)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this reminds me- the airflow version check in providers needs to go soon too - we ideally want to "duck type" off what we can I the sdk (i.e. try import except)
Question: are we going to have task-sdk installable also in Airflow 2 or is it going to be optional dependency of providers? Currently it's not that's why have all the "ifs" and they have to be part of provider's code - so such a version check in sdk will only be really possible to remove from providers if task-sdk is also installable on Airflow 2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't be installable in AF2 and if adding an optional dep in providers is what leads to, I think we should.
| from airflow.sensors.base import BaseSensorOperator # type: ignore[no-redef] | ||
|
|
||
| if AIRFLOW_V_3_1_PLUS: | ||
| from airflow.models.xcom import XCOM_RETURN_KEY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto - sdk please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR: #53180
The final step of cleanup of utils.xcom: #53065
As a follow up, I will wipe of
utils.xcomby adding deprecation warnings.^ 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.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.