hello.py 462 B

12345678910111213141516171819
  1. """
  2. Airflow的第一个DAG
  3. """
  4. from airflow import DAG
  5. from airflow.operators.bash_operator import BashOperator
  6. from datetime import datetime
  7. default_args = {
  8. "owner": "ryan.miao",
  9. "start_date": datetime(2019, 9, 1)
  10. }
  11. dag = DAG("Hello-World",
  12. description="第一个DAG",
  13. default_args=default_args,
  14. schedule_interval='0 8 * * *')
  15. t1 = BashOperator(task_id="hello", bash_command="echo 'Hello World, today is {{ ds }}'", dag=dag)