Apache Airflow Best Practices (3.2.0)
SkillCloud & infraApache Airflow best practices for DAG authoring, testing, and production deployment
Use Apache Airflow Best Practices (3.2.0) in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Apache Airflow Best Practices (3.2.0) and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Apache Airflow Best Practices (3.2.0) skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; Ahel provides instructions and does not run this skill.
No other account needed.
Add Ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
What this skill tells your AI
The instructions your AI receives, as published by baekenough/oh-my-customcode in .claude/skills/airflow-best-practices/SKILL.md and read by Ahel’s review.
DAG Authoring
Imports (Airflow 3.x)
- Use
from airflow.sdk import DAG, task, Asset— the stable public API - Legacy
from airflow.models import DAGandfrom airflow.decorators import taskare deprecated
Top-Level Code (CRITICAL)
- Avoid heavy computation at module level (executed on every DAG parse)
- Minimize imports at module level — lazy-load inside
@taskfunctions - Never call APIs, query databases, or access Variables at top level
- If Variables needed at top level, enable experimental cache with TTL
TaskFlow API (Default Pattern)
- Use
@taskdecorator for all Python tasks (preferred over classic operators) - XCom serialization is automatic — return values become XCom
- Use
@task.branchfor branching logic - Use
@task.sensorfor sensor tasks
Dynamic Task Mapping
- Use
task.expand()for runtime-determined task instances - Combine with
.partial()for fixed kwargs - Map over lists, dicts, or XCom outputs from upstream tasks
Scheduling
- Use cron expressions or timetables for
scheduleparameter - Set
catchup=Falsefor most DAGs - Use data-aware scheduling with
Asset(replacesDataset) for dependencies - Configure SLA monitoring
Task Dependencies
- Use
>>/<<operators for clarity - Group related tasks with
TaskGroup - Avoid deep nesting (max 3 levels)
Testing
Local Testing
- Use
dag.test()inif __name__ == "__main__":block for IDE debugging - Runs all tasks in single serialized process without executor
Unit Tests
- Test DAG import without errors
- Detect cycles in dependencies
- Mock external connections
- Test task logic independently
Integration Tests
- Use Airflow test mode
- Validate end-to-end workflows
- Test with sample data
Production Deployment
Performance
- Lazy-load heavy libraries inside
@taskfunctions - Use connection pooling
- Minimize DAG parse time (target < 30s for all DAGs)
- Enable parallelism appropriately
Reliability
- Set appropriate
retriesandretry_delay - Use SLA callbacks for monitoring
- Implement proper error handling with
on_failure_callback - Log important events
Migration: 2.x → 3.x
Deprecated (Remove or Replace)
| Deprecated | Replacement |
|---|---|
from airflow.models import DAG | from airflow.sdk import DAG |
from airflow.decorators import task | from airflow.sdk import task |
Dataset | Asset |
execution_date in context | dag_run.logical_date |
conf in task context | Removed — use Variables or params |
Architecture Changes
- AIP-72: Task Execution Interface — tasks run in isolated subprocesses via Execution API Server
- AIP-44: Internal API — components communicate via API, not direct DB access
- New UI: React-based web interface (replaces Flask-based UI)
References
Signals
- GitHub stars
- 43
- Forks
- 7
- Last commit
- Sep 2026
Advanced
- Item type
- skill
- Key
airflow-best-practices- Source
- github.com/baekenough/oh-my-customcode
github.com/baekenough/oh-my-customcode
More in Cloud & infra
Skill · vercel-labs
More in Cloud & infraweb-design-guidelines
Skill · vercel-labs
More in Cloud & infraturborepo
Skill · vercel
More in Cloud & inframicrosoft-foundry
Skill · microsoft
More in Cloud & infraazure-diagnostics
Skill · microsoft
More in Cloud & infrauncloud
Skill · affaan-m
More in Cloud & infra