ashb commented on code in PR #53170:
URL: https://github.com/apache/airflow/pull/53170#discussion_r2200192842
##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/version_compat.py:
##########
@@ -50,10 +45,19 @@ def get_base_airflow_version_tuple() -> tuple[int, int,
int]:
from airflow.models import BaseOperator, BaseOperatorLink # type:
ignore[no-redef]
from airflow.sensors.base import BaseSensorOperator # type:
ignore[no-redef]
+if AIRFLOW_V_3_1_PLUS:
+ from airflow.models.xcom import XCOM_RETURN_KEY
Review Comment:
Ditto - sdk please
##########
devel-common/src/tests_common/test_utils/version_compat.py:
##########
@@ -47,3 +52,13 @@ def get_sqlalchemy_version_tuple() -> tuple[int, int, int]:
SQLALCHEMY_V_1_4 = (1, 4, 0) <= get_sqlalchemy_version_tuple() < (2, 0, 0)
SQLALCHEMY_V_2_0 = (2, 0, 0) <= get_sqlalchemy_version_tuple() < (2, 1, 0)
+
+
+__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",
+]
Review Comment:
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
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/version_compat.py:
##########
@@ -36,10 +36,12 @@ def get_base_airflow_version_tuple() -> tuple[int, int,
int]:
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
Review Comment:
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)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]