amoghrajesh commented on code in PR #52808:
URL: https://github.com/apache/airflow/pull/52808#discussion_r2184872139
##########
providers/ftp/src/airflow/providers/ftp/version_compat.py:
##########
@@ -33,10 +33,21 @@ def get_base_airflow_version_tuple() -> tuple[int, int,
int]:
AIRFLOW_V_3_0_PLUS = get_base_airflow_version_tuple() >= (3, 0, 0)
+AIRFLOW_V_3_1_PLUS: bool = get_base_airflow_version_tuple() >= (3, 1, 0)
+
+if AIRFLOW_V_3_1_PLUS:
+ from airflow.sdk import BaseHook
+else:
+ from airflow.hooks.base import BaseHook # type:
ignore[attr-defined,no-redef]
if AIRFLOW_V_3_0_PLUS:
from airflow.sdk import BaseOperator
else:
from airflow.models import BaseOperator # type: ignore[no-redef]
-__all__ = ["AIRFLOW_V_3_0_PLUS", "BaseOperator"]
+if AIRFLOW_V_3_0_PLUS:
+ from airflow.sdk import BaseSensorOperator
+else:
+ from airflow.sensors.base import BaseSensorOperator # type:
ignore[no-redef]
Review Comment:
Merge this section with above if / else
--
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]