Skip to content

Commit 04787e4

Browse files
leahecolecrwilcox
andauthored
Simplify trigger dag example (GoogleCloudPlatform#6643)
* Simplify trigger dag example * fix lint * more lint Co-authored-by: Christopher Wilcox <[email protected]>
1 parent 3a29ca7 commit 04787e4

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

composer/workflows/trigger_response_dag.py

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,28 +18,17 @@
1818
import datetime
1919

2020
import airflow
21-
from airflow.operators import bash_operator
21+
from airflow.operators.bash_operator import BashOperator
2222

2323

24-
default_args = {
25-
'owner': 'Composer Example',
26-
'depends_on_past': False,
27-
'email': [''],
28-
'email_on_failure': False,
29-
'email_on_retry': False,
30-
'retries': 1,
31-
'retry_delay': datetime.timedelta(minutes=5),
32-
'start_date': datetime.datetime(2017, 1, 1),
33-
}
34-
3524
with airflow.DAG(
3625
'composer_sample_trigger_response_dag',
37-
default_args=default_args,
26+
start_date=datetime.datetime(2021, 1, 1),
3827
# Not scheduled, trigger only
3928
schedule_interval=None) as dag:
4029

4130
# Print the dag_run's configuration, which includes information about the
4231
# Cloud Storage object change.
43-
print_gcs_info = bash_operator.BashOperator(
32+
print_gcs_info = BashOperator(
4433
task_id='print_gcs_info', bash_command='echo {{ dag_run.conf }}')
4534
# [END composer_trigger_response_dag]

0 commit comments

Comments
 (0)