-
Notifications
You must be signed in to change notification settings - Fork 17.5k
Limit pandas to < 3 for DataFrame XComs #70791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
potiuk
merged 8 commits into
apache:main
from
potiuk:limit-pandas-below-3-for-dataframe-xcoms
Aug 1, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c2c0254
Limit pandas to < 3 for DataFrame XComs
potiuk 2f55df0
Sync uv.lock with the pandas < 3 constraint
potiuk 910d6ed
Add significant newsfragment for the pandas < 3 limit
potiuk 50e577b
Apply the pandas < 3 limit to the remaining providers
potiuk 693bd82
Merge branch 'main' into limit-pandas-below-3-for-dataframe-xcoms
vatsrahul1001 1e6dd6b
Regenerate provider docs index for the pandas < 3 pins
potiuk a56565f
Merge remote-tracking branch 'origin/limit-pandas-below-3-for-datafra…
potiuk 3e611b2
Explain the pandas upper bound at every site and drop a vacuous test
potiuk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| pandas is limited to ``< 3``; DataFrame XComs are refused on pandas 3 | ||
|
|
||
| A ``pandas.DataFrame`` does not survive an XCom round trip under pandas 3 the way it does | ||
| under pandas 2, so this version of Airflow constrains pandas to ``< 3`` and refuses DataFrame | ||
| XComs at runtime when a newer pandas is installed anyway. | ||
|
|
||
| Two things change under pandas 3. Its public classes are exposed from the ``pandas`` | ||
| namespace, so a DataFrame qualifies as ``pandas.DataFrame`` rather than | ||
| ``pandas.core.frame.DataFrame`` and the XCom serializer registry -- keyed on the latter -- | ||
| never dispatches to the pandas serializer. And the dtypes differ: an ``object`` column reads | ||
| back as ``str``, and missing values as ``nan`` rather than ``None``, so the *reader's* pandas | ||
| version decides what a task receives rather than the writer's. | ||
|
|
||
| Because pandas is an optional dependency, the ``< 3`` constraint alone cannot be relied on -- | ||
| a deployment may install pandas 3 directly, or pull it in through another package. It is | ||
| therefore backed by a runtime check. | ||
|
|
||
| **Behaviour changes:** | ||
|
|
||
| - With pandas 3 or newer installed, pushing **or** pulling a ``DataFrame`` through XCom now | ||
| raises ``RuntimeError`` naming the installed pandas version and the supported range. | ||
| Reads are refused as well as writes, because a payload written under pandas 2 reads back | ||
| with pandas 3 dtypes and would otherwise hand the task different data than was pushed, | ||
| with no signal. | ||
| - Previously the same situation produced an opaque | ||
| ``TypeError: cannot serialize object of type <class 'pandas.DataFrame'>`` from the | ||
| serializer registry, with nothing identifying pandas as the cause. | ||
| - Deployments that pass DataFrames through XCom must pin ``pandas < 3`` in the environment | ||
| that runs their tasks. Deployments that do not use DataFrame XComs are unaffected at | ||
| runtime. | ||
| - Nothing changes for pandas 2 users. | ||
|
|
||
| **This defers pandas 3 support rather than dropping it.** Moving from pandas 2 to pandas 3 | ||
| is a deliberate migration for users to make, given the dtype changes it brings to data that | ||
| has already been written. Support for pandas 3 will be enabled in a future Airflow release. |
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.