You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/10/17 08:18:32 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #27056: Fix ExternalTaskSensor cant check zipped dag

uranusjr commented on code in PR #27056:
URL: https://github.com/apache/airflow/pull/27056#discussion_r996747162


##########
tests/sensors/test_external_task_sensor.py:
##########
@@ -576,6 +576,19 @@ def test_external_task_sensor_waits_for_dag_check_existence(self):
             op.run(start_date=DEFAULT_DATE, end_date=DEFAULT_DATE, ignore_ti_state=True)
 
 
+def test_external_task_sensor_check_zipped_dag_existence(dag_maker):
+    with dag_maker(dag_id="external_task_sensor_dag"):
+        op = ExternalTaskSensor(
+            task_id="external_task_sensor",
+            external_dag_id="test_zip_dag",
+            external_task_id="dummy",
+            check_existence=True
+        )
+
+    with create_session() as session:
+        op._check_for_existence(session)

Review Comment:
   It’s better to use a fixture to dynamically create/delete a zip file when tests are run and instead; a static zip file in `tests/dags` is opaque and easy to miss when we do refactoring. (IIRC this happened a while ago.)
   
   See tests in `tests/models/test_dagbag.py` for some examples for this.



-- 
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-unsubscribe@airflow.apache.org

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