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/05 08:23:29 UTC

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

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


##########
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:
   @bbovenzi I've removed this check. When testing. I had thought I'd seen it get into a state where a task would end up in the database but the state was None. I can't reproduce this so have removed it. 



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