uranusjr commented on a change in pull request #20722:
URL: https://github.com/apache/airflow/pull/20722#discussion_r779977566
##########
File path: airflow/models/dagrun.py
##########
@@ -804,18 +806,42 @@ def verify_integrity(self, session: Session =
NEW_SESSION):
ti.state = State.NONE
session.merge(ti)
- # check for missing tasks
- for task in dag.task_dict.values():
- if task.start_date > self.execution_date and not self.is_backfill:
- continue
+ def task_filter(task: "BaseOperator"):
+ return task.task_id not in task_ids and (
+ self.is_backfill or task.start_date <= self.execution_date
+ )
+
+ created_counts: Dict[str, int] = Counter()
Review comment:
But `Counter` would be more useful if you change the below to something
like
```python
# create_ti_mapping is no longer needed.
def create_ti(task: "BaseOperator") -> TI:
ti = TI(task, run_id=self.run_id)
task_instance_mutation_hook(ti)
return ti
if hook_is_noop:
session.bulk_insert_mappings(TI, (TI.insert_mapping(self.run_id, t) for
t in tasks))
else:
session.bulk_save_objects(create_ti(t) for t in tasks)
created_counts.update(t.task_type for t in tasks)
```
--
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]