Uploaded image for project: 'Apache Airflow'
  1. Apache Airflow
  2. AIRFLOW-3237

Refactor example DAGs

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.10.1
    • Component/s: None
    • Labels:
      None

      Description

      I think it's important to have the example DAGs reflect good programming standards and how to write clean and concise Airflow code. Therefore, refactor the example DAGs, which mostly involves:

      • Replace set_upstream() and set_downstream() by the bitshift operators, since they exist since Airflow 1.8 and everybody uses those now.
      • Optimise imports (grouping by stdlib/3rd party/own and alphabetic ordering).
      • Place function calls with arguments on single line if line is short enough, or put each function argument on a new line, but don't mix.
      • Passing list of tasks when setting dependencies instead of making multiple set_up/down-stream calls.
      • Switch upstream dependencies into downstream dependencies since these are more logical to read IMO.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                basph Bas Harenslak
                Reporter:
                basph Bas Harenslak
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: