You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kaxil (via GitHub)" <gi...@apache.org> on 2024/10/28 00:36:53 UTC
Re: [PR] Migrate `TaskInstance` to UUID v7 primary key [airflow]
kaxil commented on code in PR #43243:
URL: https://github.com/apache/airflow/pull/43243#discussion_r1818239964
##########
airflow/api_connexion/endpoints/task_instance_endpoint.py:
##########
@@ -533,9 +533,11 @@ def post_set_task_instances_state(*, dag_id: str, session: Session = NEW_SESSION
detail=f"Task instance not found for task {task_id!r} on execution_date {execution_date}"
)
- if run_id and not session.get(
- TI, {"task_id": task_id, "dag_id": dag_id, "run_id": run_id, "map_index": -1}
- ):
+ select_stmt = select(TI).where(
+ TI.dag_id == dag_id, TI.task_id == task_id, TI.run_id == run_id, TI.map_index == -1
+ )
+
+ if run_id and not session.scalars(select_stmt).one_or_none():
Review Comment:
The reason for this is explained in [**Issues identified Point (3)**](https://github.com/apache/airflow/pull/43243#issuecomment-2439774584)
--
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