These DAGs are very thorough, and there were opportunities to showcase some best practices in DAG authoring with all these wonderful examples (without really having the ability to test as thoroughly). I have confirmed that these DAGs will render in the Airflow UI however.
Proposing to update the DAGs with various themes namely:
Using a static start_date value.
Using pendulum.datetime instead of datetime.datetime for start_date.
This is mainly for time-zone-aware DAGs it is good practice to use pendulum just in case users do want to make a DAG time zone aware.
Reduce boilerplate by using default_args when tasks share the same arg and value.
Declaring default_args directly in the DAG() instantiation.
This is more for readability so users don't have to to re-read what the default_args are if declared earlier in a DAG where only 1 DAG object exists.
Removing the need to assign the dag parameter when using the DAG() object as context manager.
Prefer the @task decorator over the PythonOperator.
These DAGs are very thorough, and there were opportunities to showcase some best practices in DAG authoring with all these wonderful examples (without really having the ability to test as thoroughly). I have confirmed that these DAGs will render in the Airflow UI however.
Proposing to update the DAGs with various themes namely:
start_date
value.pendulum.datetime
instead ofdatetime.datetime
forstart_date
.pendulum
just in case users do want to make a DAG time zone aware.default_args
when tasks share the same arg and value.default_args
directly in theDAG()
instantiation.default_args
are if declared earlier in a DAG where only 1 DAG object exists.dag
parameter when using theDAG()
object as context manager.@task
decorator over thePythonOperator
.