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.
- 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.1-alpha
hooks:
- id: airflint
args: ["-a"] # Use -a for replacing inplace