You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/04/07 09:23:21 UTC

[GitHub] [airflow] ashb commented on a diff in pull request #22793: Support DAGRun type reset through the backfill command

ashb commented on code in PR #22793:
URL: https://github.com/apache/airflow/pull/22793#discussion_r844914538


##########
airflow/models/dagrun.py:
##########
@@ -217,6 +217,12 @@ def set_state(self, state: DagRunState):
             if state == State.QUEUED:
                 self.queued_at = timezone.utcnow()
 
+    @provide_session
+    def reset_run_type(self, session: Session = None):
+        self.run_type = DagRunType.SCHEDULED
+        self.run_id = self.run_id.replace(DagRunType.BACKFILL_JOB.value, DagRunType.SCHEDULED.value)

Review Comment:
   Yeah, run_id is used in the FK of multiple tables. We can't change the run_id.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org