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/06 17:44:54 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #22793: Support DAGRun type reset through the backfill command
uranusjr commented on code in PR #22793:
URL: https://github.com/apache/airflow/pull/22793#discussion_r844221146
##########
airflow/cli/commands/dag_command.py:
##########
@@ -71,6 +72,22 @@ def dag_backfill(args, dag=None):
args.end_date = args.end_date or args.start_date
args.start_date = args.start_date or args.end_date
+ if args.reset_run_type:
+ with create_session() as session:
+ dagruns = DagRun.find(
+ dag_id=dag.get_dags_ids(),
+ execution_start_date=args.start_date,
+ execution_end_date=args.end_date,
+ run_type=DagRunType.BACKFILL_JOB,
+ )
+
+ for dr in dagruns:
+ if dr.state in [DagRunState.FAILED, DagRunState.SUCCESS]:
+ dr.reset_run_type()
+ session.commit()
Review Comment:
```suggestion
```
Not needed
--
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