potiuk commented on code in PR #39513:
URL: https://github.com/apache/airflow/pull/39513#discussion_r1598164584
##########
tests/providers/openlineage/plugins/test_listener.py:
##########
@@ -33,10 +33,20 @@
from airflow.providers.openlineage.plugins.listener import OpenLineageListener
from airflow.providers.openlineage.utils.selective_enable import
disable_lineage, enable_lineage
from airflow.utils.state import State
+from tests.test_utils.compat import AIRFLOW_V_2_10_PLUS
from tests.test_utils.config import conf_vars
pytestmark = pytest.mark.db_test
+EXPECTED_TRY_NUMBER_1 = 1 if AIRFLOW_V_2_10_PLUS else 0
Review Comment:
> @potiuk I know that we can specify min airflow version for a specific
provider version, but is there any way we can specify min version of OL
provider for specific Airflow versions? We could then specify that Airflow >=
2.10 will not accept OL provider < 1.8.0. Of course Airflow should not require
OL, just disallow Ol versions smaller than 1.8.0.
As explained above - yes and no. We can specify it in extra:
```
openlineage: ["apache-airflow-provider-openlineage>=1.8.0"]
```
But iff the dependency is optional, it only has temporary effect during
installation and ONLY if the extra is actually used. It's not enforceable - for
example you will be able to install
`apache-airflow-providers-openlineage==1.7.0` on `apache-airflow==2.10.0`
regardless what `openlinege` extra says.
So yes - we can (and probably should) specify min version of openlineage
provider, but also, if we really want to enforce it, it has to be additionally
checked at runtime. Many other libraries do very similar checks, this is where
you sometimes see a warning when starting airflow `you have this and that
version of x library but you have xxxx library that is not compatible` -
apache.beam and few other libraries do that for their extras.
It should be easy to do:
```
openlineage_version =
importlib.metadata.version("apache-airflow-providers-openlineage")
if openlineage_version and openlineage_version < .....:
log.warning(,,,)
```
--
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]