Skip to content

Commit 7d24b08

Browse files
authored
Stop using start_date in default_args in example_dags (2) (#9985)
1 parent 7cc1c8b commit 7d24b08

File tree

50 files changed

+74
-85
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+74
-85
lines changed

β€Ž.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ repos:
326326
- id: restrict-start_date-in-default_args-in-example_dags
327327
language: pygrep
328328
name: "'start_date' should not be defined in default_args in example_dags"
329-
entry: "default_args\\s*=\\s*{\\s*(\"|')start_date(\"|')"
329+
entry: "default_args\\s*=\\s*{\\s*(\"|')start_date(\"|')|(\"|')start_date(\"|'):"
330330
files: \.*example_dags.*.py$
331331
pass_filenames: true
332332
- id: check-integrations

β€Žairflow/example_dags/example_bash_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727

2828
args = {
2929
'owner': 'airflow',
30-
'start_date': days_ago(2),
3130
}
3231

3332
dag = DAG(
3433
dag_id='example_bash_operator',
3534
default_args=args,
3635
schedule_interval='0 0 * * *',
36+
start_date=days_ago(2),
3737
dagrun_timeout=timedelta(minutes=60),
3838
tags=['example']
3939
)

β€Žairflow/example_dags/example_branch_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727

2828
args = {
2929
'owner': 'airflow',
30-
'start_date': days_ago(2),
3130
}
3231

3332
dag = DAG(
3433
dag_id='example_branch_operator',
3534
default_args=args,
35+
start_date=days_ago(2),
3636
schedule_interval="@daily",
3737
tags=['example']
3838
)

β€Žairflow/example_dags/example_branch_python_dop_operator_3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828

2929
args = {
3030
'owner': 'airflow',
31-
'start_date': days_ago(2),
3231
'depends_on_past': True,
3332
}
3433

3534
dag = DAG(
3635
dag_id='example_branch_dop_operator_v3',
3736
schedule_interval='*/1 * * * *',
37+
start_date=days_ago(2),
3838
default_args=args,
3939
tags=['example']
4040
)

β€Žairflow/example_dags/example_kubernetes_executor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727

2828
args = {
2929
'owner': 'airflow',
30-
'start_date': days_ago(2)
3130
}
3231

3332
with DAG(
3433
dag_id='example_kubernetes_executor',
3534
default_args=args,
3635
schedule_interval=None,
36+
start_date=days_ago(2),
3737
tags=['example'],
3838
) as dag:
3939

β€Žairflow/example_dags/example_kubernetes_executor_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727

2828
default_args = {
2929
'owner': 'airflow',
30-
'start_date': days_ago(2)
3130
}
3231

3332
with DAG(
3433
dag_id='example_kubernetes_executor_config',
3534
default_args=default_args,
3635
schedule_interval=None,
36+
start_date=days_ago(2),
3737
tags=['example'],
3838
) as dag:
3939

β€Žairflow/example_dags/example_passing_params_via_test_command.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
"example_passing_params_via_test_command",
3131
default_args={
3232
"owner": "airflow",
33-
"start_date": days_ago(1),
3433
},
3534
schedule_interval='*/1 * * * *',
35+
start_date=days_ago(1),
3636
dagrun_timeout=timedelta(minutes=4),
3737
tags=['example']
3838
)

β€Žairflow/example_dags/example_python_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@
2626

2727
args = {
2828
'owner': 'airflow',
29-
'start_date': days_ago(2),
3029
}
3130

3231
dag = DAG(
3332
dag_id='example_python_operator',
3433
default_args=args,
3534
schedule_interval=None,
35+
start_date=days_ago(2),
3636
tags=['example']
3737
)
3838

β€Žairflow/example_dags/example_short_circuit_operator.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@
2525

2626
args = {
2727
'owner': 'airflow',
28-
'start_date': dates.days_ago(2),
2928
}
3029

31-
dag = DAG(dag_id='example_short_circuit_operator', default_args=args, tags=['example'])
30+
dag = DAG(
31+
dag_id='example_short_circuit_operator',
32+
default_args=args,
33+
start_date=dates.days_ago(2),
34+
tags=['example'],
35+
)
3236

3337
cond_true = ShortCircuitOperator(
3438
task_id='condition_is_True',

β€Žairflow/example_dags/example_skip_dag.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
args = {
2727
'owner': 'airflow',
28-
'start_date': days_ago(2),
2928
}
3029

3130

@@ -57,6 +56,6 @@ def create_test_pipeline(suffix, trigger_rule, dag_):
5756
join >> final
5857

5958

60-
dag = DAG(dag_id='example_skip_dag', default_args=args, tags=['example'])
59+
dag = DAG(dag_id='example_skip_dag', default_args=args, start_date=days_ago(2), tags=['example'])
6160
create_test_pipeline('1', 'all_success', dag)
6261
create_test_pipeline('2', 'one_success', dag)

0 commit comments

Comments
 (0)