yuseok89 commented on code in PR #71549:
URL: https://github.com/apache/airflow/pull/71549#discussion_r3868072120


##########
airflow-core/src/airflow/jobs/scheduler_job_runner.py:
##########
@@ -2946,8 +2946,7 @@ def _schedule_dag_run(
                 default=None,
             )
             for task_instance in unfinished_task_instances:
-                task_instance.state = TaskInstanceState.SKIPPED
-                session.merge(task_instance)
+                task_instance.set_state(TaskInstanceState.SKIPPED, 
session=session)

Review Comment:
   Good catch, thanks. Inlined it keeping set_state semantics, one flush after 
the loop. Also dropped the redundant session.merge and added a test for the 
preserve case.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to