contributing-docs/28_example_dag_review_checklist.rst
.. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
This document provides a checklist for reviewing example Dags submitted to Apache Airflow. The goal is to ensure that example Dags are clean, consistent, and follow best practices while serving their multiple purposes:
Example Dags should clearly indicate which category they belong to:
PEP 8 <https://peps.python.org/pep-0008/>_ formatting.doc_md for in-UI documentation where appropriate.Provider examples have slightly different expectations:
The following example Dags are kept aligned with this checklist and are good
templates for new tutorial-style examples. Both implement the same
"measurement correction" storyline so the TaskFlow and PythonOperator
styles can be compared side by side:
example_measurement_correction_decorator.py <https://github.com/apache/airflow/blob/main/providers/standard/src/airflow/providers/standard/example_dags/example_measurement_correction_decorator.py>_ — TaskFlow version.example_measurement_correction_operator.py <https://github.com/apache/airflow/blob/main/providers/standard/src/airflow/providers/standard/example_dags/example_measurement_correction_operator.py>_ — classic PythonOperator version.When introducing a new tutorial-style example, prefer copying the shape of
these two files (module docstring, doc_md, per-task docstrings, no
external dependencies) rather than starting from scratch.