prabhusneha commented on code in PR #47644:
URL: https://github.com/apache/airflow/pull/47644#discussion_r2007015664


##########
providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:
##########
@@ -35,10 +35,17 @@
 from airflow.configuration import conf
 from airflow.exceptions import AirflowException
 from airflow.hooks.base import BaseHook
+from airflow.providers.common.compat.version_compat import AIRFLOW_V_3_0_PLUS
 from airflow.providers.common.sql.hooks.sql import DbApiHook
 from airflow.security import utils
 from airflow.utils.helpers import as_flattened_list
-from airflow.utils.operator_helpers import AIRFLOW_VAR_NAME_FORMAT_MAPPING
+
+if AIRFLOW_V_3_0_PLUS:
+    from airflow.sdk.execution_time.context import 
AIRFLOW_VAR_NAME_FORMAT_MAPPING
+else:
+    from airflow.utils.operator_helpers import (  # type: ignore[no-redef, 
attr-defined]
+        AIRFLOW_VAR_NAME_FORMAT_MAPPING,
+    )

Review Comment:
   getting static check failures when only no-redef is used:
   
   ```
   providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:46: 
error:
   Module "airflow.utils.operator_helpers" has no attribute
   "AIRFLOW_VAR_NAME_FORMAT_MAPPING"  [attr-defined]
           from airflow.utils.operator_helpers import (  # type: ignore[no-re...
           ^
   providers/apache/hive/src/airflow/providers/apache/hive/hooks/hive.py:46: 
note: Error code "attr-defined" not covered by "type: ignore" comment
   Found 6 errors in 5 files (checked 1178 source files)
   Error 1 returned
   ```



-- 
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]

Reply via email to