amoghrajesh commented on code in PR #51873: URL: https://github.com/apache/airflow/pull/51873#discussion_r2176851128
########## providers/airbyte/src/airflow/providers/airbyte/hooks/airbyte.py: ########## @@ -26,7 +26,11 @@ from requests import Session from airflow.exceptions import AirflowException -from airflow.hooks.base import BaseHook + +try: + from airflow.sdk import BaseHook +except ImportError: + from airflow.hooks.base import BaseHook # type: ignore Review Comment: We will need both `no-redef` and `attr-defined` when using conditionally because: - attr-defined: mypy can’t verify that BaseHook exists in airflow.hooks.base at static time. - no-redef: assigning to the name BaseHook in both the try and except blocks Adding both. There could be better ways to go about this, but i think i can revisit that ########## providers/alibaba/src/airflow/providers/alibaba/cloud/hooks/analyticdb_spark.py: ########## @@ -34,7 +34,11 @@ from alibabacloud_tea_openapi.models import Config from airflow.exceptions import AirflowException -from airflow.hooks.base import BaseHook + +try: + from airflow.sdk import BaseHook +except ImportError: + from airflow.hooks.base import BaseHook # type: ignore Review Comment: Handled -- 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]
