Airflow DAG Definition (Operator Style)
An Airflow DAG definition in the classic operator style, using only the no-op EmptyOperator so the file describes a topology and performs no work. Carries the six-task ETL graph shared across the Airflow JSON, Argo, Graphviz and Mermaid fixtures.
"""Airflow-shaped DAG definition. A PARSING fixture: it is never imported by a scheduler here,
and every operator is the no-op EmptyOperator, so the file describes a topology and does nothing.
Topology (shared with the serialized-JSON, Graphviz, Mermaid and Argo fixtures in this category):
ingest_orders -> validate_orders -> transform_orders -+-> load_warehouse -+-> notify_owner
+-> refresh_dashboard -+
"""
from __future__ import annotations
import datetime as dt
from airflow import DAG
from airflow.operators.empty import EmptyOperator
DEFAULT_ARGS = {
"owner": "example-data-team",
"retries": 2,
"retry_delay": dt.timedelta(minutes=5),
"depends_on_past": False,
}
with DAG(
dag_id="orders_etl",
description="Nightly orders extract, validate, transform and publish.",
schedule="17 2 * * *",
start_date=dt.datetime(2026, 1, 1),
catchup=False,
max_active_runs=1,
default_args=DEFAULT_ARGS,
tags=["orders", "etl", "example"],
) as dag:
ingest_orders = EmptyOperator(task_id="ingest_orders")
validate_orders = EmptyOperator(task_id="validate_orders")
transform_orders = EmptyOperator(task_id="transform_orders")
load_warehouse = EmptyOperator(task_id="load_warehouse")
refresh_dashboard = EmptyOperator(task_id="refresh_dashboard")
notify_owner = EmptyOperator(task_id="notify_owner", trigger_rule="all_done")
ingest_orders >> validate_orders >> transform_orders
transform_orders >> [load_warehouse, refresh_dashboard] >> notify_owner
Specifications
- System
- Airflow
- Style
- operator + >> chaining
- Tasks
- 6
- Edges
- 6
- Schedule
- 17 2 * * *
- Catchup
- false
- Operators
- EmptyOperator (no-op)
- Topological Order
- ingest_orders, validate_orders, transform_orders, load_warehouse, refresh_dashboard, notify_owner
Testing contract
Expected to pass- Scenario
- Extract a task graph statically from an Airflow DAG file without importing it
- Expected result
- Six tasks and six edges are recovered, including the list-shorthand fan-out from transform_orders to load_warehouse and refresh_dashboard
What is a .py file?
Python (.py) is a plain-text source file for the Python programming language — a dynamically typed, indentation-structured language widely used for scripting, data science, web back-ends, and automation. A .py file is compiled to bytecode and run by the Python interpreter.
How to use this file
Use an example .py file to test syntax highlighters, linters (like flake8 or ruff), formatters (black), tree-sitter grammars, and language-detection or code-editor tooling against known-correct source.
How to use this file for testing
“Airflow DAG Definition (Operator Style)” is a deterministic Novus Examples fixture for Graph data, Data engineering, Conversion testing. Node/edge datasets in GraphML and GEXF (directed and undirected, with attributes and weights) — for testing network importers, layout tools, and graph converters.
Documented properties for this file: 6 edges. Compare results against paired or grouped companions on this page when present (clean↔damaged, searchable↔scanned, or format twins) so scores stay reproducible across runs.
Download the file once, keep the path stable in CI or local scripts, and treat the spec table as the contract: dimensions, seeds, field lists, and roles are intentional. Corrupt or invalid samples are labelled as such — expect parsers to fail loudly rather than silently accept them.
Pipeline and infrastructure fixtures are inert configuration: steps reference fictional images and scripts, and nothing here executes. Run your linter, schema validator, migrator, or policy engine against them, and expect the deprecated-syntax and intentionally invalid variants to be rejected.
Code examples
python airflow-dag-basic.pyRelated files
- pyAirflow TaskFlow API DAGA decorator-based Airflow TaskFlow DAG where dependencies are implied by function calls rather than >> operators — the shape static DAG extractors most often get wrong. Every task returns a literal, so nothing performs I/O.

- yamlArgo Workflow DAG TemplateAn Argo Workflows DAG template carrying the same six-task ETL topology as the Airflow, Graphviz and Mermaid fixtures in this category, so a converter or visualiser can be scored against one known answer across four formats.

- yamlArgo Workflow Steps TemplateArgo's steps template, whose double-nested list is a genuine parser trap: the outer list is sequential and the inner list is parallel, so a reader that flattens it reports four sequential steps instead of three groups.

- cwlCWL Scatter and Cross-ProductCWL scatter in both forms: a single-parameter scatter over an array input, and a two-parameter scatter with scatterMethod flat_crossproduct. The scatter dimensionality is what distinguishes correct CWL engines from approximate ones.

- cwlCWL Workflow (Six-Step Topology)A CWL Workflow carrying the same six-step ETL topology as the Airflow and Argo fixtures, with dependencies expressed as step output references and a multi-source input resolved by pickValue. For cross-format DAG conversion tests.

- dotGraphviz Pipeline DAGThe shared six-task ETL topology as a Graphviz digraph, with node and edge defaults, per-node attribute overrides, a same-rank constraint and C-style comments. Carries the identical graph to the Airflow, Argo, CWL and Mermaid fixtures.

Generated by generation/pipelines.py. Free for any use, no attribution required — license.