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 2019/06/10 15:47:33 UTC

[GitHub] [airflow] ashb commented on a change in pull request #5403: [AIRFLOW-4759] Batch queries in set_state.

ashb commented on a change in pull request #5403: [AIRFLOW-4759] Batch queries in set_state.
URL: https://github.com/apache/airflow/pull/5403#discussion_r292069567
 
 

 ##########
 File path: airflow/api/common/experimental/mark_tasks.py
 ##########
 @@ -77,12 +88,14 @@ def set_state(task, execution_date, upstream=False, downstream=False,
     """
     assert timezone.is_localized(execution_date)
 
-    assert task.dag is not None
-    dag = task.dag
+    task_dags = {task.dag for task in tasks}
+    assert len(task_dags) == 1
 
 Review comment:
   `assert` will be disabled at runtime if python is run with omptimizations, so it _may_ be a bad idea to check this invariant like this. (i.e. maybe we should replace it with a `raise Something()`

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services