amoghrajesh commented on code in PR #53387:
URL: https://github.com/apache/airflow/pull/53387#discussion_r2215125802


##########
airflow-core/src/airflow/api_fastapi/core_api/datamodels/ui/calendar.py:
##########
@@ -21,7 +21,12 @@
 
 from pydantic import BaseModel
 
-from airflow.utils.state import DagRunState
+from airflow.version_compat import AIRFLOW_V_3_1_PLUS
+
+if AIRFLOW_V_3_1_PLUS:
+    from airflow.sdk.definitions.state import DagRunState
+else:
+    from airflow.utils.state import DagRunState  # type: ignore[no-redef]

Review Comment:
   This isn't correct. Core cannot have a version check for imports.
   
   We can also not import again from SDK into core, we end up with the same 
problem we have now.
   
   I'd suggest to investigate the usage patterns of different components of the 
state.py and move them to places where it makes sense. It might make sense to 
duplicate some of those across core + sdk. 
   
   But this module in general feels like a good candidate to stay in the 
`airflow-shared` library to me.
   cc @ashb



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