uranusjr commented on code in PR #31569:
URL: https://github.com/apache/airflow/pull/31569#discussion_r1208802508
##########
airflow/api/common/mark_tasks.py:
##########
@@ -480,14 +482,16 @@ def set_dag_run_state_to_failed(
tasks.append(task)
# Mark non-finished tasks as SKIPPED.
- tis = session.query(TaskInstance).filter(
- TaskInstance.dag_id == dag.dag_id,
- TaskInstance.run_id == run_id,
- TaskInstance.state.not_in(State.finished),
- TaskInstance.state.not_in([State.RUNNING, State.DEFERRED,
State.UP_FOR_RESCHEDULE]),
+ tis = session.execute(
+ select(TaskInstance).filter(
+ TaskInstance.dag_id == dag.dag_id,
+ TaskInstance.run_id == run_id,
+ TaskInstance.state.not_in(State.finished),
+ TaskInstance.state.not_in([State.RUNNING, State.DEFERRED,
State.UP_FOR_RESCHEDULE]),
+ )
)
- tis = [ti for ti in tis]
+ tis = [ti for ti, in tis]
Review Comment:
Use `scalars` instead?
--
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]