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/12/02 20:31:38 UTC

[GitHub] [airflow] bbovenzi commented on a diff in pull request #28066: Return list of tasks that will be queued

bbovenzi commented on code in PR #28066:
URL: https://github.com/apache/airflow/pull/28066#discussion_r1038509576


##########
airflow/www/views.py:
##########
@@ -2298,13 +2299,24 @@ def _mark_dagrun_state_as_queued(self, dag_id: str, dag_run_id: str, confirmed:
         if not dag:
             return {"status": "error", "message": f"Cannot find DAG: {dag_id}"}
 
-        new_dag_state = set_dag_run_state_to_queued(dag=dag, run_id=dag_run_id, commit=confirmed)
+        set_dag_run_state_to_queued(dag=dag, run_id=dag_run_id, commit=confirmed)
 
         if confirmed:
             return {"status": "success", "message": "Marked the DagRun as queued."}
 
         else:
-            details = [str(t) for t in new_dag_state]
+            # Identify tasks that will be queued up to run when confirmed
+            all_task_ids = [task.task_id for task in dag.tasks]
+
+            existing_tis = session.query(TaskInstance.task_id).filter(
+                TaskInstance.dag_id == dag.dag_id,
+                TaskInstance.run_id == dag_run_id,
+                TaskInstance.state is not None,

Review Comment:
   Do we need to check for `state is not None`? Aren't we looking for tasks that don't have a corresponding instance for this run?



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