WordPress / openverse

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.
https://openverse.org
MIT License
251 stars 202 forks source link

Create a "DAG Authoring Handbook" #1506

Open AetherUnbound opened 2 years ago

AetherUnbound commented 2 years ago

Description

By virtue of being workflows which can be defined in pure Python, there are innumerable ways to set up and author DAGs. Particularly as we get more contributors, it may be useful and prudent to define a set of patterns to use (and to avoid) when authoring DAGs. This document could include information on:

It could even potentially include some boilerplate DAG templates (I know that I almost never write a DAG from scratch :sweat_smile:)!

Alternatives

Additional context

Implementation

zackkrida commented 2 years ago

I'd encourage us to think about how much of this could be handled with custom lint rules, templates, and things like that over a manual handbook. Happy to have some documentation about best practices, but the more we can automate the better!

sarayourfriend commented 2 years ago

Some of the syntax and name type requirements could be defined in a flake8 plugin: https://flake8.pycqa.org/en/latest/plugin-development/index.html

Filenames can be handled by https://pypi.org/project/flake8-filename/

A pylint custom checker might be easier to implement than a flake8 plugin though... https://pylint.pycqa.org/en/latest/development_guide/how_tos/custom_checkers.html