Repository navigation
Preserve XCom value types when editing in the UI - #75496
Merged
vatsrahul1001 merged 2 commits intoOct 29, 2026
Merged
Conversation
anzinmhd
requested review from
bbovenzi,
choo121600,
guan404ming,
pierrejeambrun,
ryanahamilton,
shubhamraj-git and
vatsrahul1001
as code owners
October 23, 2026 15:34
bbovenzi
approved these changes
Oct 27, 2026
bbovenzi
enabled auto-merge (squash)
October 27, 2026 15:23
vatsrahul1001
disabled auto-merge
October 29, 2026 09:45
Contributor
Backport successfully created: v3-4-testNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
|
github-actions Bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Oct 29, 2026
aws-airflow-bot
pushed a commit
to aws-mwaa/upstream-to-airflow
that referenced
this pull request
Oct 29, 2026
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 29, 2026
vatsrahul1001
pushed a commit
that referenced
this pull request
Oct 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Saving an XCom through the UI can unintentionally change its stored type. This PR preserves the stored value’s type when loading the edit form and retains its JSON representation when saving.
The bug was reproduced on
mainand independently confirmed in the officialapache/airflow:3.4.0b2image.Problem
For an XCom containing the string
"123", opening Edit and clicking Save without changing anything replaces it with the number123.The problem is not limited to unchanged saves. Because the editor loses the distinction between a string and another JSON type, editing a string to another JSON-looking value can also result in an unintended type conversion. This broader risk follows from the same conversion path; intentional-edit scenarios have not been separately verified.
There are two opportunities for unintended conversion:
deserialize=true. The API can parse a stored JSON-looking string into another type before returning it to the editor.JSON.parse()when saving. Strings containing JSON literals can consequently become numbers, booleans, objects, arrays, or null.An unchanged save provides a minimal reproduction: it demonstrates that the stored type changes without the user requesting any modification.
Fix
Load the edit form from the stored value using
deserialize=falseandstringify=false, then populate the JSON editor withJSON.stringify().These changes address both conversion points:
For example:
"123""123"with quotation marks"123"123123without quotation marks123The editor now makes the type distinction explicit. Users can retain quotation marks when editing a string or deliberately remove them to change its type.
The backend API and display-only XCom view are unchanged.
Steps to reproduce
"123".return_value.deserialize=false&stringify=false."value":"123".Before: The response contains
"value":123. Saving unchanged has replaced the stored string with a number.After: The response still contains
"value":"123". The stored string is preserved.Using the same raw-response parameters before and after distinguishes a stored-value change from display formatting or response deserialization.
Version verification
"123"into the number123.The beta verification confirms that the bug affects
3.4.0b2; the fix itself was verified on the local development checkout.Tests and validation
Added eight regression cases covering:
The tests verify the read query parameters, the JSON editor content, and the value sent in the update request after saving without edits.
Validation completed:
deserialize=false&stringify=false.The automated regression cases and manual reproduction specifically cover unchanged saves.
Before
Opening Edit and saving without changes converts the stored string
"123"into the number123.before.mov
After
The editor retains the string’s JSON quotation marks, and saving without changes preserves
"value":"123"in the raw API response.after.mov
Was generative AI tooling used to co-author this PR?