From 70a84c30c5c9fcc68541d191969c84bbbe911119 Mon Sep 17 00:00:00 2001 From: Arinda Arif <79823430+arinda-arif@users.noreply.github.com> Date: Mon, 20 Mar 2023 15:47:02 +0700 Subject: [PATCH] fix: override depends_on_past's dag level value (#762) --- ext/scheduler/airflow2/resources/base_dag.py | 2 +- ext/scheduler/airflow2/resources/expected_compiled_template.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/scheduler/airflow2/resources/base_dag.py b/ext/scheduler/airflow2/resources/base_dag.py index 9528ade368..1839a08acc 100644 --- a/ext/scheduler/airflow2/resources/base_dag.py +++ b/ext/scheduler/airflow2/resources/base_dag.py @@ -42,7 +42,7 @@ "queue": "{{ .Metadata.Airflow.Queue }}", {{- end }} "owner": {{.Job.Owner | quote}}, - "depends_on_past": False, + "depends_on_past": {{ if .Job.Behavior.DependsOnPast }}True{{- else -}}False{{- end -}}, "retries": {{ if gt .Job.Behavior.Retry.Count 0 -}} {{.Job.Behavior.Retry.Count}} {{- else -}} DAG_RETRIES {{- end}}, "retry_delay": {{ if gt .Job.Behavior.Retry.Delay.Nanoseconds 0 -}} timedelta(seconds={{.Job.Behavior.Retry.Delay.Seconds}}) {{- else -}} timedelta(seconds=DAG_RETRY_DELAY) {{- end}}, "retry_exponential_backoff": {{if .Job.Behavior.Retry.ExponentialBackoff -}}True{{- else -}}False{{- end -}}, diff --git a/ext/scheduler/airflow2/resources/expected_compiled_template.py b/ext/scheduler/airflow2/resources/expected_compiled_template.py index 6d6e9c2b81..b8846fff3c 100644 --- a/ext/scheduler/airflow2/resources/expected_compiled_template.py +++ b/ext/scheduler/airflow2/resources/expected_compiled_template.py @@ -36,7 +36,7 @@ "optimus_hostname": "http://airflow.example.io" }, "owner": "mee@mee", - "depends_on_past": False, + "depends_on_past": True, "retries": 4, "retry_delay": timedelta(seconds=DAG_RETRY_DELAY), "retry_exponential_backoff": True,