Skip to content

About

Airflow-pet for DAG quality

Resources

Stars

11 stars

Watchers

0 watching

Forks

Repository files navigation

🐾 Daggie -- The Airflow DAG Quality Auditor

A friendly (and sometimes strict!) animated auditor for Apache Airflow 3.1+

Daggie analyzes your DAGs, scores them based on Airflow best practices,
and shows the results using a fully animated React character inside the DAG page.


🐾 Daggie -- Being Happy

Daggie Happy Animation

🐾 Daggie -- Being Sad

Daggie Happy Animation

🐾 Daggie -- Sample

Daggie Happy Animation

✨ Features

🔍 1. Daggie-Score API (FastAPI Plugin)

A FastAPI application embedded inside Airflow.
It exposes the endpoint:

GET /api/daggie-score/score?dag_id=<your_dag_id>

Returns:

  • Overall DAG score (0--100)
  • Points earned vs max possible
  • Detailed checks with:
    • name
    • weight
    • passed / failed
    • reason

This works by scanning the DAG loaded in Airflow's DagBag.


🧠 2. Scoring Rules (Built-in)

Daggie evaluates:

  • Owner configured\
  • default_args defined\
  • retries & retry_delay\
  • schedule / timetable\
  • catchup behavior\
  • tags present\
  • DAG documentation\
  • max_active_runs sanity\
  • number of tasks\
  • snake_case task IDs\
  • placeholder check: no import-time side effects

All rules have weights and descriptive explanations.


🧩 3. Custom Scoring Plugins (Extensible)

You can add your own checks by adding Python callables:

Example:

from daggie_score import register_check

@register_check
def check_bigquery_usage(dag):
    if "bigquery" in dag.tags:
        return {
            "name": "BigQuery DAG Standards",
            "weight": 8,
            "passed": False,
            "reason": "Needs special review."
        }

Custom checks are merged into the official scoring pipeline.


🎨 4. React UI Plugin (Built for Airflow UI)

The React frontend appears in:

/dags/<dag_id>/plugin/simple-react-app

It shows:

  • Score summary\
  • Weighted check breakdown\
  • Clean Material-UI styled presentation\
  • Animated Daggie character whose mood changes:
    • 😀 Happy (score > 80)
    • 😐 Neutral (score 50--80)
    • 😢 Sad (score < 50)

Daggie Animation

Built entirely using CSS + React.
No Lottie/Javascript animations required.
Runs smoothly inside Airflow without external assets.


🚀 Installation Guide

1. Copy Plugin Backend

Place the plugin folder into:

$AIRFLOW_HOME/plugins/daggie_score_plugin/

Restart Airflow Webserver & Scheduler.


2. Build the React Frontend

Inside your React project:

npm install
npm run build

Your bundle should output:

dist/Daggie.js

Copy it into:

$AIRFLOW_HOME/plugins/daggie_dag_build_quality/Daggie.js

3. Enable UI Plugin

Ensure your AirflowPlugin class includes:

fastapi_apps = [
    {
        "app": app,
        "url_prefix": "/api/daggie-score",
        "name": "Daggie Score API",
    }
]

and your UI plugin exposes a link under the DAG page.


📡 Test the API in Browser

http://localhost:8080/api/daggie-score/score?dag_id=example_dag

Response example:

{
  "ok": true,
  "result": {
    "dag_id": "example_dag",
    "score": 72,
    "raw_points": 36,
    "max_points": 50,
    "checks": [...]
  }
}

🐾 Thanks for using Daggie!

Your DAGs deserve a friendly auditor 💙
If you want additional moods, animations, or scoring rules---just ask!

About

Airflow-pet for DAG quality

Resources

Stars

11 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages