Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix XCom key handling when keys contain special characters like slash#58344

Merged
pierrejeambrun merged 6 commits intoapache:mainfrom
henry3260:Xcom_Slash_key-Fix
Dec 11, 2025
Merged

Fix XCom key handling when keys contain special characters like slash#58344
pierrejeambrun merged 6 commits intoapache:mainfrom
henry3260:Xcom_Slash_key-Fix

Conversation

Copy link
Contributor

henry3260 commented Nov 15, 2025

This PR picks up the work from @Brunda10 in PR #56042, which had become stale.

  • Fixes 404 errors for XCom keys containing special characters (e.g., /).
  • Keys are now URL-encoded (quoted) before being sent to the API.
  • Keys are decoded (unquoted) when received from the API.
  • Adds required unit tests to verify the fix, as requested in the original PR.

Closes: #55410


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

henry3260 requested review from amoghrajesh, ashb, bugraoz93, ephraimbuddy, jason810496, kaxil, pierrejeambrun, rawwar and shubhamraj-git as code owners November 15, 2025 13:28
boring-cyborg bot added area:API Airflow's REST/HTTP API area:task-sdk labels Nov 15, 2025
potiuk approved these changes Nov 15, 2025
Copy link
Member

potiuk left a comment

Choose a reason for hiding this comment

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

It looks good to me from general approach - but it's not my area of expertise, so someone who works on API should take a look as this is an important part of our core APIs

ashb reviewed Nov 16, 2025
ashb reviewed Nov 16, 2025
ashb reviewed Nov 16, 2025
ashb reviewed Nov 16, 2025
ashb previously requested changes Nov 16, 2025
Copy link
Member

ashb left a comment

Choose a reason for hiding this comment

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

Not confinced the quote/unqoute behaviour is right. And if xcom_key is wrong -- it's a required field.

henry3260 reacted with heart emoji
henry3260 force-pushed the Xcom_Slash_key-Fix branch 2 times, most recently from cd15ca0 to 5e89a44 Compare November 17, 2025 16:55
henry3260 force-pushed the Xcom_Slash_key-Fix branch from 5e89a44 to 542ba3a Compare November 17, 2025 18:18
henry3260 requested a review from ashb November 18, 2025 01:56
jason810496 reviewed Nov 21, 2025
Copy link
Member

jason810496 left a comment

Choose a reason for hiding this comment

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

Nice!

It would be nice to add pytest.mark.parametrize with slash value key in task-sdk-integration-tests/tests/task_sdk_tests/test_xcom_operations.py tests.

Thanks!

henry3260 requested review from gopidesupavan and jscheffl as code owners November 21, 2025 18:18
henry3260 requested a review from jason810496 November 21, 2025 18:18
henry3260 force-pushed the Xcom_Slash_key-Fix branch 2 times, most recently from 364ccfd to 1c2835e Compare November 22, 2025 07:18
henry3260 requested a review from pierrejeambrun November 28, 2025 12:50
pierrejeambrun approved these changes Nov 28, 2025
Copy link
Member

pierrejeambrun left a comment *
edited
Loading

Choose a reason for hiding this comment

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

LGTM, @ashb do you mind reconsidering your request for change by any chance and giving this a second look? :)

jason810496 reacted with thumbs up emoji henry3260 reacted with rocket emoji
henry3260 force-pushed the Xcom_Slash_key-Fix branch from bd882d9 to 7385d94 Compare December 3, 2025 09:44
Copy link
Member

pierrejeambrun left a comment

Choose a reason for hiding this comment

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

@henry3260 Do you mind rebasing to fix the conflicts. We can probably go ahead and merge, the PR is looking good.

Copy link
Contributor Author

henry3260 commented Dec 4, 2025

@henry3260 Do you mind rebasing to fix the conflicts. We can probably go ahead and merge, the PR is looking good.

Sure

henry3260 force-pushed the Xcom_Slash_key-Fix branch from 7a4b010 to 828390f Compare December 4, 2025 18:11
Copy link
Contributor Author

henry3260 commented Dec 5, 2025

@henry3260 Do you mind rebasing to fix the conflicts. We can probably go ahead and merge, the PR is looking good.

All CI tests have passed. Ready for merge!

pierrejeambrun dismissed ashb's stale review December 10, 2025 16:36

stale

Copy link
Member

pierrejeambrun left a comment *
edited
Loading

Choose a reason for hiding this comment

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

A few nits to fix and we should be good to merge.

henry3260 force-pushed the Xcom_Slash_key-Fix branch from 4e80248 to 658f49d Compare December 10, 2025 19:39
pierrejeambrun approved these changes Dec 11, 2025
Copy link
Member

pierrejeambrun commented Dec 11, 2025

Thanks for the PR.

pierrejeambrun added the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Dec 11, 2025
pierrejeambrun added this to the Airflow 3.1.5 milestone Dec 11, 2025
pierrejeambrun added the full tests needed We need to run full set of tests for this PR to merge label Dec 11, 2025
pierrejeambrun merged commit 6e3e512 into apache:main Dec 11, 2025
127 checks passed
pierrejeambrun removed the full tests needed We need to run full set of tests for this PR to merge label Dec 11, 2025
github-actions bot pushed a commit that referenced this pull request Dec 11, 2025
...s like slash (#58344)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

* fix unit test
(cherry picked from commit 6e3e512)

Co-authored-by: Henry Chen
Copy link

github-actions bot commented Dec 11, 2025

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test

jason810496 pushed a commit that referenced this pull request Dec 11, 2025
...s like slash (#58344) (#59311)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

* fix unit test
(cherry picked from commit 6e3e512)

Co-authored-by: Henry Chen
ephraimbuddy pushed a commit that referenced this pull request Dec 12, 2025
...s like slash (#58344) (#59311)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

* fix unit test
(cherry picked from commit 6e3e512)

Co-authored-by: Henry Chen
henry3260 deleted the Xcom_Slash_key-Fix branch December 15, 2025 19:41
ephraimbuddy pushed a commit that referenced this pull request Jan 6, 2026
...s like slash (#58344) (#59311)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

* fix unit test
(cherry picked from commit 6e3e512)

Co-authored-by: Henry Chen
jhgoebbert pushed a commit to jhgoebbert/airflow_Owen-CH-Leung that referenced this pull request Feb 8, 2026
...apache#58344)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

* fix unit test
Subham-KRLX pushed a commit to Subham-KRLX/airflow that referenced this pull request Mar 4, 2026
...apache#58344)

* Fix XCom key handling when keys contain special characters like slash

* remove all the unquote

* add test

* remove all the quote() in client.py

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

Reviewers

pierrejeambrun pierrejeambrun approved these changes

jason810496 jason810496 approved these changes

potiuk potiuk approved these changes

kaxil Awaiting requested review from kaxil kaxil is a code owner

amoghrajesh Awaiting requested review from amoghrajesh amoghrajesh is a code owner

ephraimbuddy Awaiting requested review from ephraimbuddy ephraimbuddy is a code owner

rawwar Awaiting requested review from rawwar rawwar is a code owner

bugraoz93 Awaiting requested review from bugraoz93 bugraoz93 is a code owner

shubhamraj-git Awaiting requested review from shubhamraj-git shubhamraj-git is a code owner

ashb Awaiting requested review from ashb ashb is a code owner

gopidesupavan Awaiting requested review from gopidesupavan

jscheffl Awaiting requested review from jscheffl

Assignees

No one assigned

Labels

area:API Airflow's REST/HTTP API area:task-sdk backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Milestone

Airflow 3.1.5

Development

Successfully merging this pull request may close these issues.

Execution API / XCom push fails when TaskFlow returns dict with a key containing "/" (slash) in Airflow 3

5 participants