turbaszek commented on a change in pull request #14048:
URL: https://github.com/apache/airflow/pull/14048#discussion_r570160429



##########
File path: airflow/models/taskinstance.py
##########
@@ -166,13 +170,23 @@ def clear_task_instances(
                 ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
             ti.state = State.NONE
             session.merge(ti)
+
+        tr_filter.append((ti.dag_id, ti.task_id, ti.execution_date, 
ti.try_number))

Review comment:
       Should we use `TaskInstanceKey` and:
   
https://github.com/apache/airflow/blob/2a3960f359b1fcd5eed64fff472c4e463da74beb/airflow/models/taskinstance.py#L1987
   
   To avoid code duplication?

##########
File path: airflow/models/taskinstance.py
##########
@@ -166,13 +170,23 @@ def clear_task_instances(
                 ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
             ti.state = State.NONE
             session.merge(ti)
+
+        tr_filter.append((ti.dag_id, ti.task_id, ti.execution_date, 
ti.try_number))

Review comment:
       Should we apend `tis` and then use:
   
https://github.com/apache/airflow/blob/2a3960f359b1fcd5eed64fff472c4e463da74beb/airflow/models/taskinstance.py#L1987
   
   to avoid code duplication?

##########
File path: airflow/models/taskinstance.py
##########
@@ -166,13 +170,23 @@ def clear_task_instances(
                 ti.max_tries = max(ti.max_tries, ti.prev_attempted_tries)
             ti.state = State.NONE
             session.merge(ti)
+
+        tr_filter.append((ti.dag_id, ti.task_id, ti.execution_date, 
ti.try_number))

Review comment:
       Should we append `tis` and then use:
   
https://github.com/apache/airflow/blob/2a3960f359b1fcd5eed64fff472c4e463da74beb/airflow/models/taskinstance.py#L1987
   
   to avoid code duplication?




----------------------------------------------------------------
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.

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


Reply via email to