|
1 | | -from airflow import DAG |
2 | 1 | from datetime import datetime, timedelta |
3 | | -from airflow.providers.standard.operators.bash import BashOperator |
4 | 2 |
|
| 3 | +from airflow import DAG |
| 4 | +from airflow.providers.standard.operators.bash import BashOperator |
5 | 5 |
|
6 | 6 | 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), |
15 | 15 | } |
16 | 16 |
|
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"') |
22 | 21 |
|
23 | 22 | t1 |
24 | | - |
0 commit comments