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


##########
tests/sensors/test_external_task_sensor.py:
##########
@@ -30,14 +30,25 @@
 
 from airflow import exceptions, settings
 from airflow.decorators import task as task_deco
-from airflow.exceptions import AirflowException, AirflowSensorTimeout, 
AirflowSkipException, TaskDeferred
+from airflow.exceptions import (
+    AirflowException,
+    AirflowPokeFailException,
+    AirflowSensorTimeout,
+    AirflowSkipException,
+    TaskDeferred,
+)
 from airflow.models import DagBag, DagRun, TaskInstance
 from airflow.models.dag import DAG
 from airflow.models.serialized_dag import SerializedDagModel
 from airflow.models.xcom_arg import XComArg
 from airflow.operators.bash import BashOperator
 from airflow.operators.empty import EmptyOperator
 from airflow.operators.python import PythonOperator
+from tests.test_utils.compat import AIRFLOW_V_2_10_PLUS, 
ignore_provider_compatibility_error
+
+with ignore_provider_compatibility_error("2.10.0", __file__):

Review Comment:
   Yes in this case it means that the TESTS are importing the Fail Policy. What 
happens in the compatibility checks we are running **current** tests against 
**old** airflow versions - which means that simply the tests are not 
backwards-compatible with old airflow version (and they are not because they 
are importing FailPolicy which does not exist in previous Airflow versions). 
   
   So what **should** happen here, is that the test **also** should be made 
compatible with old airlfow versions - in this case likely by implementing a 
compatibility check in `tests/test_utils/compat.py` -> there should be a check  
which airlfow version you have and have different imports/expectations.
   
   Details on the compatibility checks is 
https://github.com/apache/airflow/blob/main/contributing-docs/testing/unit_tests.rst#compatibility-provider-unit-tests-against-older-airflow-releases
 - including explanation on how to run them locally and what are different ways 
you can implement "test compatibility".
   
   End goal is that the tests should succeed with both - current "main" airlfow 
and all the previous airflow versions - which will be ultimate proof that the 
change you implemented is "backwards compatible" and that someone can install 
new provider with old airflow version (down to 2.7 for now) 



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