Apache Airflow
2 fixes in apache/airflow, maintained by Apache Software Foundation.
Back to all open-source fixesAbout Apache Airflow
Apache Airflow is a platform for programmatically authoring, scheduling, and monitoring workflows. Pipelines are defined in Python as Dags of tasks, and Airflow handles scheduling, retries, dependencies, and task-to-task communication through XComs. It is one of the most widely adopted orchestration tools in data engineering, maintained by a large community under the Apache Software Foundation.
My work on it
My work on Airflow has centered on correctness in the core Execution API and the standard operators: the kind of bugs that never raise an error but quietly return the wrong data or send a pipeline down the wrong branch. For each one I wrote up a detailed report with a minimal reproduction, traced the root cause to a gap between what the code assumed and what the underlying library or calendar actually does, and then fixed it with regression tests.
Making XCom slicing match Python semantics across every database
The problem. The mapped-XCom slice endpoint is meant to behave exactly like Python list slicing. It translated slices into SQLAlchemy’s Query.slice(a, b), which compiles to OFFSET a LIMIT (b − a) and doesn’t clamp a negative limit. A “crossed” slice such as items[5:2], which Python evaluates to an empty list, produced a negative SQL LIMIT. SQLite treats that as “no limit” and silently returned the wrong rows, while PostgreSQL and MySQL rejected it with a server error.
The fix. I identified the code paths where two independently computed bounds could cross, showed why the remaining paths were already safe, and added explicit handling so crossed slices return an empty result before any SQL is generated.
How I tested it. Reproduced the bug with a standard-library-only script and end-to-end against the endpoint, then added regression tests for positive, negative, and descending slice cases so behavior is identical on SQLite, PostgreSQL, and MySQL.
Fixing overnight time windows in BranchDateTimeOperator
The problem. With time-only targets that span midnight (for example 22:00 → 02:00), the operator worked before midnight but, after midnight, compared the current time against the next night’s window instead of the current one. Every run between midnight and the end of the window silently took the wrong branch, so downstream tasks were skipped or run incorrectly with nothing in the logs.
The fix. The window calculation now checks which side of midnight the current time falls on and anchors the window to the correct day, while keeping the existing inclusive-boundary behavior. I also confirmed it composes correctly with a separate timezone fix being worked on in parallel.
How I tested it. Added a test covering times before midnight, after midnight, and exactly on the boundary of an overnight window. The after-midnight cases fail without the fix and pass with it.