Skip to content

Instantly share code, notes, and snippets.

@nickefy
Last active June 6, 2021 19:27
Show Gist options
  • Save nickefy/20e9ed1ee30fad18bae53d65aa52203b to your computer and use it in GitHub Desktop.
Save nickefy/20e9ed1ee30fad18bae53d65aa52203b to your computer and use it in GitHub Desktop.
Airflow DAG without framework
from datetime import timedelta
from airflow.models import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.utils.dates import days_ago
from airflow.operators.print_text_old import PrintText
text_to_print_dag = 'Hello World!'
args = {
'owner': 'Airflow',
'start_date': '2021-01-01',
'retries': 1,
}
dag = DAG(
dag_id='HELLO WORLD',
default_args=args,
schedule_interval='@daily',
dagrun_timeout=timedelta(minutes=5),
catchup=False,
)
run_this = PrintText(
task_id='Print Hello World',
text_to_print=text_to_print_dag,
)
run_this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment