Created
February 26, 2026 10:30
-
-
Save eidosam/6eecca21c96cdd8d66da232198106dab to your computer and use it in GitHub Desktop.
Reproducer for Airflow 3 issue: Missing tasks in DAG runs for dynamic DAGs when the DAG's end_date is changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Reproducer for Airflow 3 issue: | |
| Missing tasks in DAG runs for dynamic DAGs when the DAG's end_date is changed. | |
| Expected: | |
| Each DagRun contains one task instance: 'noop'. | |
| Observed: | |
| Some DagRuns exist but have zero task instances. | |
| Tested with: | |
| - Apache Airflow 3.0.6 | |
| """ | |
| import logging | |
| from pathlib import Path | |
| import pendulum | |
| import yaml | |
| from airflow import DAG | |
| from airflow.providers.standard.operators.empty import EmptyOperator | |
| logger = logging.getLogger(__name__) | |
| CONFIG_FILE = Path(__file__).parent / "airflow3-dynamic-dag-dagrun-missing-tasks-repro.yaml" | |
| with open(CONFIG_FILE) as f: | |
| parsed_config = yaml.safe_load(f) | |
| for dag_config in parsed_config.get("dags", []): | |
| dag_id = dag_config["dag_id"] | |
| start_date = pendulum.parse(dag_config["start_date"], tz="UTC") | |
| end_date = pendulum.parse(dag_config["end_date"], tz="UTC") if "end_date" in dag_config else None | |
| logger.info( | |
| "Creating DAG %s with start_date=%s end_date=%s", | |
| dag_id, | |
| start_date, | |
| end_date, | |
| ) | |
| dag = DAG( | |
| dag_id=dag_id, | |
| start_date=start_date, | |
| end_date=end_date, | |
| schedule="@daily", | |
| catchup=True, | |
| max_active_runs=16, | |
| ) | |
| with dag: | |
| EmptyOperator(task_id="noop") | |
| globals()[dag_id] = dag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dags: | |
| - dag_id: dag_x | |
| start_date: "2026-02-01" | |
| end_date: "2026-02-15" | |
| - dag_id: dag_y | |
| start_date: "2026-02-01" | |
| end_date: "2026-02-15" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment