Enforce Best Practices for all your Airflow DAGs. ⭐
- use datetime instead of days_ago in DAG start_date
- task decorator instead of PythonOperator and PythonVenvOperator
- dag decorator instead of DAG
- jinja string instead of Variable.get
⚠️ airflint does not remove imports. For removing unused imports please use autoflake additionally.
Please check the known issues first, in case you find any bugs. If you cannot find them there, please open an Issue.
- fix Official Airflow
DeprecationWarning
s
To install it from PyPI run:
pip install airflint
Then just call it like this:
Alternatively you can add the following repo to your pre-commit-config.yaml
:
- repo: https://github.com/feluelle/airflint
rev: v0.1.2-alpha
hooks:
- id: airflint
args: ["-a"] # Use -a for replacing inplace