Skip to content

Commit a67ce85

Browse files
♻️ refactor: improve the example quality for BashOperator
1 parent 8ee6a72 commit a67ce85

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed
Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
from airflow import DAG
21
from datetime import datetime, timedelta
3-
from airflow.providers.standard.operators.bash import BashOperator
42

3+
from airflow import DAG
4+
from airflow.providers.standard.operators.bash import BashOperator
55

66
default_args = {
7-
'owner' : 'Mostafa Ghadimi',
8-
'description' : 'Use of the DockerOperator',
9-
'depend_on_past' : False,
10-
'start_date' : datetime(2023, 4, 4),
11-
'email_on_failure' : False,
12-
'email_on_retry' : False,
13-
'retries' : 1,
14-
'retry_delay' : timedelta(minutes=5)
7+
"owner": "Mostafa Ghadimi",
8+
"description": "Use of the BashOperator",
9+
"depend_on_past": False,
10+
"start_date": datetime(2023, 4, 4),
11+
"email_on_failure": False,
12+
"email_on_retry": False,
13+
"retries": 1,
14+
"retry_delay": timedelta(minutes=5),
1515
}
1616

17-
with DAG('docker_dag_sample', default_args=default_args, schedule="5 10 * * *", catchup=False) as dag:
18-
t1 = BashOperator(
19-
task_id='print_hello',
20-
bash_command='echo "hello world"'
21-
)
17+
with DAG(
18+
"bash_dag_sample", default_args=default_args, schedule="5 10 * * *", catchup=False
19+
) as dag:
20+
t1 = BashOperator(task_id="print_hello", bash_command='echo "hello world"')
2221

2322
t1
24-

0 commit comments

Comments
 (0)