Skip to content

Reject zero step in mapped XCom slices#70124

Open
viiccwen wants to merge 1 commit into
apache:mainfrom
viiccwen:reject-zero-xcom-slice-step
Open

Reject zero step in mapped XCom slices#70124
viiccwen wants to merge 1 commit into
apache:mainfrom
viiccwen:reject-zero-xcom-slice-step

Conversation

@viiccwen

@viiccwen viiccwen commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

closes #70123

A mapped XCom slice with step=0 is invalid, but the endpoint silently treated it as step=1, hiding malformed client requests.

This change returns HTTP 422 with an invalid_step response for every Execution API version. The default step of 1 is now applied only when the parameter is omitted, preserving positive and negative step behavior.


Was generative AI tooling used to co-author this PR?
  • Yes - GPT-5.6 Sol

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg Bot added area:API Airflow's REST/HTTP API area:task-sdk labels Jul 20, 2026
@viiccwen

Copy link
Copy Markdown
Contributor Author

cc @jason810496, @henry3260. 🙌

@henry3260 henry3260 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

IMO, I don't think this needs a new API version migration though. The old behavior (silently treating step=0 as step=1) is exactly the bug being fixed — preserving it for clients declaring older API versions means their malformed requests keep being silently misinterpreted, which is what #70123 wants to surface.

A zero slice step is invalid sequence semantics, but the endpoint
silently treated it as one and hid malformed client requests.

Signed-off-by: viiccwen <vicwen@apache.org>
@viiccwen
viiccwen force-pushed the reject-zero-xcom-slice-step branch from 67ace09 to 2cdaadd Compare July 21, 2026 03:36
@viiccwen

Copy link
Copy Markdown
Contributor Author

Thanks for the fix!

IMO, I don't think this needs a new API version migration though. The old behavior (silently treating step=0 as step=1) is exactly the bug being fixed — preserving it for clients declaring older API versions means their malformed requests keep being silently misinterpreted, which is what #70123 wants to surface.

Sure, that makes sense. I just updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:task-sdk

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mapped XCom slice endpoint accepts a zero step

2 participants