hussein-awala commented on code in PR #39336:
URL: https://github.com/apache/airflow/pull/39336#discussion_r1594675865
##########
airflow/jobs/backfill_job_runner.py:
##########
@@ -245,7 +245,16 @@ def _update_counters(self, ti_status: _DagRunTaskStatus,
session: Session) -> No
session.execute(
update(TI)
.where(filter_for_tis)
- .values(state=TaskInstanceState.SCHEDULED)
+ .values(
+ state=TaskInstanceState.SCHEDULED,
+ try_number=case(
+ (
+ or_(TI.state.is_(None), TI.state !=
TaskInstanceState.UP_FOR_RESCHEDULE),
Review Comment:
Do we need the or if you reverse it? (Positive check on up_for_reschedule)
##########
airflow/models/dagrun.py:
##########
@@ -1567,7 +1568,16 @@ def schedule_tis(
TI.run_id == self.run_id,
tuple_in_condition((TI.task_id, TI.map_index),
schedulable_ti_ids_chunk),
)
- .values(state=TaskInstanceState.SCHEDULED)
+ .values(
+ state=TaskInstanceState.SCHEDULED,
+ try_number=case(
+ (
+ or_(TI.state.is_(None), TI.state !=
TaskInstanceState.UP_FOR_RESCHEDULE),
Review Comment:
Same here
##########
airflow/jobs/backfill_job_runner.py:
##########
@@ -425,6 +434,8 @@ def _task_instances_for_dag_run(
try:
for ti in dag_run.get_task_instances(session=session):
if ti in schedulable_tis:
+ if not ti.state == TaskInstanceState.UP_FOR_RESCHEDULE:
Review Comment:
Why not !=?
--
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]