Copilot commented on code in PR #64035:
URL: https://github.com/apache/airflow/pull/64035#discussion_r3066475037


##########
providers/common/ai/src/airflow/providers/common/ai/operators/agent.py:
##########
@@ -65,7 +65,7 @@ def get_link(
             return ""
         from urllib.parse import urlparse
 
-        from airflow.configuration import conf
+        from airflow.providers.common.compat.sdk import conf
 

Review Comment:
   There are imports inside `get_link` (both `urlparse` and `conf`). Airflow 
codebase guidelines generally require imports at module top-level; please move 
these imports to the top of the file unless there is a specific circular-import 
or lazy-load justification.



##########
providers/keycloak/src/airflow/providers/keycloak/auth_manager/keycloak_auth_manager.py:
##########
@@ -47,7 +47,7 @@
 try:
     from airflow.providers.common.compat.sdk import AirflowException, conf
 except ModuleNotFoundError:
-    from airflow.configuration import conf
+    from airflow.providers.common.compat.sdk import conf
     from airflow.exceptions import AirflowException

Review Comment:
   The `except ModuleNotFoundError` fallback now re-imports `conf` from the 
same `airflow.providers.common.compat.sdk` module that just failed, so the 
fallback path will still raise and never provides compatibility. The fallback 
should import `conf` from the legacy location (e.g. `airflow.configuration`) 
while keeping `AirflowException` from `airflow.exceptions` (or otherwise use a 
module that is guaranteed to exist when the compat module is missing).



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