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 2021/12/09 00:29:39 UTC

[GitHub] [airflow] dstandish commented on a change in pull request #18724: Use `DagRun.run_id` instead of `execution_date` when updating state of TIs(UI & REST API)

dstandish commented on a change in pull request #18724:
URL: https://github.com/apache/airflow/pull/18724#discussion_r765345335



##########
File path: airflow/api_connexion/endpoints/task_instance_endpoint.py
##########
@@ -297,15 +296,34 @@ def post_set_task_instances_state(dag_id, session):
         error_message = f"Task ID {task_id} not found"
         raise NotFound(error_message)
 
-    execution_date = data['execution_date']
-    try:
-        session.query(TI).filter_by(execution_date=execution_date, task_id=task_id, dag_id=dag_id).one()
-    except NoResultFound:
-        raise NotFound(f"Task instance not found for task {task_id} on execution_date {execution_date}")
+    execution_date = data.get('execution_date')
+    run_id = data.get('dag_run_id')
+

Review comment:
       should we check that either run date or exec date is passed but not both? i think i have seen that kind of
   i have seen elsewhere in 




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