kacpermuda commented on code in PR #39513:
URL: https://github.com/apache/airflow/pull/39513#discussion_r1598085567


##########
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:
   > Well. But openlineage provider should (or not?) handle try_num before and 
after the change? 
   
   Maybe I am missing something, but I think that what's happening now after 
#39336 has been merged. The tests requires some adjusting, but the core of OL 
works fine. The PR already modifies the OL listener to handle `try_num` 
depending on Airflow version (`_get_try_number_success()` function). The only 
difference between previous and new `try_num` (for OL provider use case) is 
that `try_num` is not increased before `on_task_instance_success` is called, so 
inside that method we don't have to subtract 1 from `try_num` to get the same 
value as in `on_task_instance_failed` and `on_task_instance_running`. From 
Airflow 2.10 (or 2.9.2 if cherry picked) we can use `try_num` without any 
modifications in whole OL listener.
   
   As to the versions:
   - For Airflow >= 2.10 (or 2.9.2 if cherry picked) the OL provider < 1.7.2 
(or 1.8.0 depending on release) will not work properly, as it will not contain 
this `try_num` adjustment. We should maybe provide a max Airflow version for 
previous releases of OL provider or a min provider version for Airflow version 
starting 2.10 (or 2.9.2 if cherry picked).
   - For all airflow versions (>= 2.7 when OL provider was introduced) the OL 
provider >= 1.7.2 (or 1.8.0 depending on release) should work just fine, imho, 
as there is an adjustment for Airflow version (`_get_try_number_success()` 
function).
   
   



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to