Support pandas 3 for DataFrame XComs - #70558
Open
potiuk wants to merge 3 commits into
Open
Conversation
potiuk
requested review from
amoghrajesh,
ashb,
kaxil and
o-nikolas
as code owners
July 27, 2026 19:03
pandas 3 exposes its public classes from the `pandas` namespace, so a DataFrame is now qualified as `pandas.DataFrame` rather than `pandas.core.frame.DataFrame`. The serializer was registered only under the old name, so pushing a DataFrame through XCom raised "cannot serialize object of type <class 'pandas.DataFrame'>". Both names are registered so values written by either version stay readable. pandas 3 also infers a str column where it used to infer object, and keeps its missing values as NA instead of stringifying them, which the amazon and salesforce tests asserted on.
Deployments need to know that every component has to carry the pandas 3 support before pandas 3 reaches any worker, that a rollback strands the XComs written in the meantime, and that a pulled DataFrame now takes its dtypes from the reader's pandas version.
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.
pandas 3 exposes its public classes from the
pandasnamespace, so a DataFrame is qualified aspandas.DataFramerather thanpandas.core.frame.DataFrame. The serde registry is keyed on that name and only knew the old one, so under pandas 3 no DataFrame could be pushed through XCom at all:Both names are now registered, so a DataFrame written by either pandas version can be read by either. Verified across all four combinations (writer x reader), with the payload written by one interpreter and read by the other:
object, missing =Noneobject, missing =Nonestr, missing =nanstr, missing =nanThe reader's pandas version decides the dtypes, not the writer's — that, and the fact that a component without this change cannot read a pandas-3-written DataFrame XCom, is what the significant newsfragment documents.
Two provider tests also asserted on pandas 2 behaviour (
objectdtype, missing values stringified to"nan"/"None") and are now version-aware. The production paths were already correct.Split out of #70501, which holds the development environment on pandas 2 in the meantime.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 5) following the guidelines