From 860f131979421cb7a4d954aef3d8cccb5f6cb54e Mon Sep 17 00:00:00 2001 From: heumsi Date: Mon, 29 Jan 2024 11:46:24 +0900 Subject: [PATCH] Update dags --- 01-batch-serving(airflow)/dags/01-bash-operator.py | 11 ++++------- 01-batch-serving(airflow)/dags/02-python-operator.py | 8 ++++---- .../dags/03-python-operator-with-context.py | 8 ++++---- .../dags/04-python-operator-with-jinja.py | 8 ++++---- 4 files changed, 16 insertions(+), 19 deletions(-) diff --git a/01-batch-serving(airflow)/dags/01-bash-operator.py b/01-batch-serving(airflow)/dags/01-bash-operator.py index bff14238..90b60a6c 100644 --- a/01-batch-serving(airflow)/dags/01-bash-operator.py +++ b/01-batch-serving(airflow)/dags/01-bash-operator.py @@ -11,17 +11,14 @@ # 'priority_weight': 10 # DAG의 우선 순위를 설정할 수 있음 # 'end_date': datetime(2022, 4, 24) # DAG을 마지막으로 실행할 Date # 'execution_timeout': timedelta(seconds=300), # 실행 타임아웃 : 300초 넘게 실행되면 종료 - # 'on_failure_callback': some_function # 만약에 Task들이 실패하면 실행할 함수 - # 'on_success_callback': some_other_function - # 'on_retry_callback': another_function } # with 구문으로 DAG 정의 with DAG( - dag_id='bash_dag', - default_args=default_args, - schedule_interval='@once', - tags=['my_dags'] + dag_id='bash_dag', + default_args=default_args, + schedule_interval='@once', + tags=['my_dags'] ) as dag: # BashOperator 사용 task1 = BashOperator( diff --git a/01-batch-serving(airflow)/dags/02-python-operator.py b/01-batch-serving(airflow)/dags/02-python-operator.py index dc2ea9f2..3e4b060f 100644 --- a/01-batch-serving(airflow)/dags/02-python-operator.py +++ b/01-batch-serving(airflow)/dags/02-python-operator.py @@ -21,10 +21,10 @@ def print_current_date(): # with 구문으로 DAG 정의 with DAG( - dag_id='python_dag1', - default_args=default_args, - schedule_interval='30 0 * * *', # UTC 시간 기준 0시 30분에 Daily로 실행하겠다! 한국 시간 기준 오전 9시 30분 - tags=['my_dags'] + dag_id='python_dag1', + default_args=default_args, + schedule_interval='30 0 * * *', # UTC 시간 기준 0시 30분에 Daily로 실행하겠다! 한국 시간 기준 오전 9시 30분 + tags=['my_dags'] ) as dag: python_task = PythonOperator( task_id='print_current_date', diff --git a/01-batch-serving(airflow)/dags/03-python-operator-with-context.py b/01-batch-serving(airflow)/dags/03-python-operator-with-context.py index 462ecfc0..6ae9ddfc 100644 --- a/01-batch-serving(airflow)/dags/03-python-operator-with-context.py +++ b/01-batch-serving(airflow)/dags/03-python-operator-with-context.py @@ -43,10 +43,10 @@ def print_current_date_with_context_variable(*args, **kwargs): # with 구문으로 DAG 정의 with DAG( - dag_id='python_dag_with_context', - default_args=default_args, - schedule_interval='30 0 * * *', - tags=['my_dags'] + dag_id='python_dag_with_context', + default_args=default_args, + schedule_interval='30 0 * * *', + tags=['my_dags'] ) as dag: PythonOperator( task_id='print_current_date_with_context_variable', diff --git a/01-batch-serving(airflow)/dags/04-python-operator-with-jinja.py b/01-batch-serving(airflow)/dags/04-python-operator-with-jinja.py index 61e3b608..5e9dfdc6 100644 --- a/01-batch-serving(airflow)/dags/04-python-operator-with-jinja.py +++ b/01-batch-serving(airflow)/dags/04-python-operator-with-jinja.py @@ -29,10 +29,10 @@ def print_current_date_with_jinja(date): # with 구문으로 DAG 정의 with DAG( - dag_id='python_dag_with_jinja', - default_args=default_args, - schedule_interval='30 0 * * *', - tags=['my_dags'] + dag_id='python_dag_with_jinja', + default_args=default_args, + schedule_interval='30 0 * * *', + tags=['my_dags'] ) as dag: execution_date = "{{ ds }}" # Template 정의