Tool and pre-commit hook airflow DAG integrity validation
Project description
aircheck
A tool for airflow DAG integrity validation.
The aim of the project is two-fold:
- enable the users to run checks that would fail locally, before they fail in the airflow UI
- allow to enforce standards related to certain DAG properties.
The first part involves:
- checking if modules containing DAGs are properly loaded (i.e. no
ImportErrorsetc.) - checking for cycles in DAGs
- checking for duplicated DAGs
The latter allows users to enforce that:
- all DAGs have IDs starting with a certain prefix (e.g. indicating the team developing the DAG)
- DAG IDs don't contain whitespaces (those can confuse the airflow UI)
- every DAG has at least one task associated with it (i.e. there are no 'empty' DAGs).
Installation
PyPI
aircheck can be installed with pip.
pip install aircheck
From source
Another option is to install aircheck from the source GitHub repo.
git clone https://github.com/AleksanderWWW/aircheck.git
cd aircheck && pip install .
Optionally install dev requirements, like pytest, ruff etc.
cd aircheck && pip install .[dev]
Usage
After a successful installation, the project can be used in three main ways.
Commandline tool
aircheck ./dags/dag1.py ./dags/dag2.py --check-whitespace --dag-id-prefix <prefix>
Pre-commit hook
- repo: https://github.com/AleksanderWWW/aircheck
rev: v0.1.2
hooks:
- id: aircheck
args: ["--check-empty-dags", "--dag-path" "<non-standard path>"]
Python package
from aircheck.core.checks import check_for_duplicated_dags, check_for_empty_dag
from aircheck.core.load import load_dags
dags = load_dags(["./dags/dag1.py", "./dags/dag2.py"])
check_for_duplicated_dags(dags)
for dag in dags:
check_for_empty_dag(dag)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aircheck-0.1.2.tar.gz.
File metadata
- Download URL: aircheck-0.1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a6e3d27d6c880c5f60b88b26d0a0e71ac75c6be7d0fb40c1f73c1221745bc53
|
|
| MD5 |
59ea549a447d9cb1048583d6e3d9c3ff
|
|
| BLAKE2b-256 |
155c6bf3b80ec72ec1fdf60427bd88100a0edc8d4c8b2a25d20e1346d24133b6
|
File details
Details for the file aircheck-0.1.2-py2.py3-none-any.whl.
File metadata
- Download URL: aircheck-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1d4d44c5d29f5f83fdd6f270958d5e3eea751231e927e1bdac10566ff586358
|
|
| MD5 |
1091da7cc1effec298eb589a2d478720
|
|
| BLAKE2b-256 |
a41491ec6958e0784fc1106cd6e287286cb877fee211d99d84e78b86daf216e5
|