---
title: "Accelerate testing in Apache Airflow through DAG versioning"
description: "Zalando's Performance Marketing team runs multiple isolated versions of its Airflow-orchestrated marketing ROI pipeline on one shared test server, one per pull request."
url: "https://swe.quest/articles/accelerate-testing-in-apache-airflow-through-dag-versioning-47ddaa996af2a67d"
canonical: "https://engineering.zalando.com/posts/2022/06/accelerate-apache-airflow-testing-through-dag-versioning.html"
source: "Zalando Engineering"
published: "2022-06-09"
difficulty: "medium"
kind: "Case study"
reading_minutes: 8
tags: ["data-pipelines","testing","deployment","ci-cd","python"]
---

# Accelerate testing in Apache Airflow through DAG versioning

A post on [Zalando Engineering](https://swe.quest/sources/zalando.md), published 2022-06-09, 8 min read, Case study. Original: [https://engineering.zalando.com/posts/2022/06/accelerate-apache-airflow-testing-through-dag-versioning.html](https://engineering.zalando.com/posts/2022/06/accelerate-apache-airflow-testing-through-dag-versioning.html)

## Summary

Zalando's Performance Marketing team runs multiple isolated versions of its Airflow-orchestrated marketing ROI pipeline on one shared test server, one per pull request. Each branch is deployed as a packaged DAG zip named after the branch. A patched Airflow DAG class reads the zip name to inject the environment into DAG ids and tags and to add unpacked folders to the Jinja template search path. A cron job tears environments down when PRs close. Matching data environments are created from stored DDLs as suffixed Spark databases on S3, using views over test tables instead of copying data, so new environments spin up in under a minute versus up to 30 minutes for a new MWAA server.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Data pipelines](https://swe.quest/tags/data-pipelines.md) (Data & databases)
- [Testing](https://swe.quest/tags/testing.md) (Engineering practices)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)
- [CI/CD](https://swe.quest/tags/ci-cd.md) (Reliability & operations)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- Apache Airflow DAGs ([easy posts on Data pipelines](https://swe.quest/tags/data-pipelines.md?difficulty=easy))
- Spark/Hive tables ([easy posts on Data pipelines](https://swe.quest/tags/data-pipelines.md?difficulty=easy))
- CI deployment on pull requests ([easy posts on CI/CD](https://swe.quest/tags/ci-cd.md?difficulty=easy))

## Keywords

Apache Airflow, Databricks, Spark, Amazon MWAA, AWS S3, Jinja, zFlow

## Related posts

- [Lessons Learned From Running Apache Airflow at Scale](https://swe.quest/articles/lessons-learned-from-running-apache-airflow-at-scale-465dd0ced6d11da7.md): Shopify Engineering · 2022-05-23 · Medium · 12 min read · Scheduling, Data pipelines, Multi-tenancy, Scaling, Kubernetes
  Shopify runs Airflow 2.2 on Kubernetes with the Celery executor and MySQL 8, and its largest environment handles over 10,000 DAGs and 150,000 runs per day.
- [How Grab built Scarlet: the AI teammate that turns a Slack message into a production data pipeline](https://swe.quest/articles/how-grab-built-scarlet-the-ai-teammate-that-turns-a-slack-message-into-a-cb0afbb754a543cf.md): Grab Engineering · 2026-11-23 · Medium · 12 min read · AI agents, Data pipelines, Testing, Identity & auth, LLMs
  Grab's ADW team rebuilt Scarlet, its Slack-based data-pipeline agent, around a short core prompt plus a versioned library of Markdown skills (platform, routing, repository, workflow) loaded on demand, shrinking the prompt about 25x and letting new teams onboard by adding one reviewed repository skill.
- [How SproutMe Cut Integration Test Time by 92.9% with DuckDB](https://swe.quest/articles/how-sproutme-cut-integration-test-time-by-92-9-with-duckdb-9ab70e2382f9172c.md): DuckDB · 2026-11-24 · Medium · 5 min read · Testing, Analytics & OLAP, CI/CD, Data pipelines, Developer productivity
  SproutMe runs its Dagster + dbt ad-analytics pipeline against a local DuckDB file for development and CI while keeping BigQuery in production, switching targets via environment variables (including forcing TZ=UTC to match BigQuery timestamp semantics).
- [Create a database branch with GitHub Actions](https://swe.quest/articles/create-a-database-branch-with-github-actions-d979dde1d3eb17f6.md): Turso · 2024-01-18 · Medium · 5 min read · CI/CD, SQLite, Databases
  A GitHub Actions workflow triggered on branch creation can call the Turso Platform API to seed a new database from an existing one, giving each Git branch its own isolated database.
- [Data Lineage at Slack](https://swe.quest/articles/data-lineage-at-slack-fbf2aa4b9e9054d0.md): Slack Engineering · 2021-08-17 · Medium · 8 min read · Data pipelines, Privacy, Analytics & OLAP
  Slack built a central Data Lineage Service that automatically captures table- and column-level lineage by hooking Airflow success callbacks and dashboard audit logs, then parsing the submitted SQL with ANTLR (backed by a large unit-test suite).

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
