Skip to content

Commit

Permalink
[add] new dags
Browse files Browse the repository at this point in the history
  • Loading branch information
tuancamtbtx committed Jul 2, 2024
1 parent 96fb5d7 commit fac5f6d
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
Empty file added airflow/configs/test.yaml
Empty file.
36 changes: 36 additions & 0 deletions airflow/dags/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from airflow import DAG
from airflow.operators.python import PythonOperator
from airflow.utils.dates import days_ago

# Define default arguments
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
}

# Define the function to be executed by the PythonOperator
def print_hello_world():
print("Hello, World!")

# Define the DAG
dag = DAG(
'print_hello_world',
default_args=default_args,
description='A simple DAG to print Hello, World!',
schedule_interval=None,
start_date=days_ago(1),
tags=['example'],
)

# Define the PythonOperator
hello_world_task = PythonOperator(
task_id='print_hello_world',
python_callable=print_hello_world,
dag=dag,
)

# Set the task dependencies
hello_world_task

0 comments on commit fac5f6d

Please sign in to comment.