Skip to content

Conversation

@henry3260
Copy link
Contributor

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.

Copy link
Member

@potiuk 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
ashb previously requested changes Nov 16, 2025
Copy link
Member

@ashb 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 henry3260 force-pushed the Xcom_Slash_key-Fix branch 2 times, most recently from cd15ca0 to 5e89a44 Compare November 17, 2025 16:55
@henry3260 henry3260 requested a review from ashb November 18, 2025 01:56
Copy link
Member

@jason810496 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 henry3260 force-pushed the Xcom_Slash_key-Fix branch 2 times, most recently from 364ccfd to 1c2835e Compare November 22, 2025 07:18
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

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? :)

Copy link
Member

@pierrejeambrun 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.

@henry3260
Copy link
Contributor Author

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

Sure

@henry3260
Copy link
Contributor Author

@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!

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

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.

@pierrejeambrun
Copy link
Member

Thanks for the PR.

@pierrejeambrun 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 pierrejeambrun added this to the Airflow 3.1.5 milestone Dec 11, 2025
@pierrejeambrun pierrejeambrun added the full tests needed We need to run full set of tests for this PR to merge label Dec 11, 2025
@pierrejeambrun pierrejeambrun merged commit 6e3e512 into apache:main Dec 11, 2025
127 checks passed
@pierrejeambrun 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 <henryhenry0512@gmail.com>
@github-actions
Copy link

Backport successfully created: v3-1-test

Status Branch Result
v3-1-test PR Link

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 <henryhenry0512@gmail.com>
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 <henryhenry0512@gmail.com>
@henry3260 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 <henryhenry0512@gmail.com>
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 backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

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