potiuk commented on code in PR #39609:
URL: https://github.com/apache/airflow/pull/39609#discussion_r1599780939


##########
airflow/settings.py:
##########
@@ -207,6 +209,35 @@ def configure_vars():
     DONOT_MODIFY_HANDLERS = conf.getboolean("logging", 
"donot_modify_handlers", fallback=False)
 
 
+def _run_openlineage_runtime_check():
+    """
+    Ensure compatibility of OpenLineage provider package and Airflow version.
+
+    Airflow 2.10.0 introduced some core changes (#39336) that made versions <= 
1.8.0 of OpenLineage
+    provider incompatible with future Airflow versions (>= 2.10.0).
+    """
+    ol_package = "apache-airflow-providers-openlineage"
+    try:
+        ol_version = metadata.version(ol_package)

Review Comment:
   It could be done this way, yes. But also there is no need to use 
ProvidersManager at all. In this case if provider is installed from sources, 
it's not installed as package at all so when providers are installed from 
sources this if will return immediately (same as openlineage provider not 
installed). Which is what we expect - because when we use airflow from sources, 
we know both airflow and provider are correctly latest versions.
   
   ```python
       ol_provider = importlib.version("apache-airflow-providers-openlinege") 
       if not ol_provider:
           return
   ```



##########
airflow/settings.py:
##########
@@ -207,6 +209,35 @@ def configure_vars():
     DONOT_MODIFY_HANDLERS = conf.getboolean("logging", 
"donot_modify_handlers", fallback=False)
 
 
+def _run_openlineage_runtime_check():
+    """
+    Ensure compatibility of OpenLineage provider package and Airflow version.
+
+    Airflow 2.10.0 introduced some core changes (#39336) that made versions <= 
1.8.0 of OpenLineage
+    provider incompatible with future Airflow versions (>= 2.10.0).
+    """
+    ol_package = "apache-airflow-providers-openlineage"
+    try:
+        ol_version = metadata.version(ol_package)

Review Comment:
   So your original code was good.



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