Skip to main content

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 ImportErrors etc.)
  • 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.0
  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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aircheck-0.1.1.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aircheck-0.1.1-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file aircheck-0.1.1.tar.gz.

File metadata

  • Download URL: aircheck-0.1.1.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

Hashes for aircheck-0.1.1.tar.gz
Algorithm Hash digest
SHA256 de4706c3482a92310c3d0ea41306ad5fc89bedece9a6ba42f1578abb92da645b
MD5 c665e15622e5206fa8cdc6a1caca9712
BLAKE2b-256 25928f1fc785ef3436f1e2ce86317a3da0fb68d5d7f9a2da55b2ef0a9800309f

See more details on using hashes here.

File details

Details for the file aircheck-0.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: aircheck-0.1.1-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

Hashes for aircheck-0.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8b5d3aa7667666c7112217442b5222144eabbee0c37e8fd0456861f8aba7203a
MD5 1d902e2334b06c3f7bc279f0fd9f98ed
BLAKE2b-256 68c1ddeed5f1c765672b3fb0a59390b4d52f14e19baa9df8b5123625997245e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page