Skip to content

GH-50579: [Python] Fix test_categorical_order_survives_roundtrip pandas 3.X deprecation#50608

Merged
rok merged 1 commit into
apache:mainfrom
GujaLomsadze:GH-50579-fix-categorical-roundtrip
Jul 22, 2026
Merged

GH-50579: [Python] Fix test_categorical_order_survives_roundtrip pandas 3.X deprecation#50608
rok merged 1 commit into
apache:mainfrom
GujaLomsadze:GH-50579-fix-categorical-roundtrip

Conversation

@GujaLomsadze

@GujaLomsadze GujaLomsadze commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Rationale for this change

Follow-up to #50543. test_categorical_order_survives_roundtrip constructs a
pd.Categorical with value "a" not in categories ["b","c","d"]. pandas 3.0.3
raises a deprecation for out-of-category values, which #50543's filterwarnings
config now turns into an error - failing nightly wheels across platforms.

What changes are included in this PR?

Replace the out-of-category "a" value with an explicit None, preserving the
test's intent (ordered categorical with non-sorted categories survives a Parquet
roundtrip, ARROW-6302) plus a null.

Are these changes tested?

Yes. Reproduced the failure with pandas 3.0.3, confirmed the test passes after
the change; all categorical tests in the module pass.

Are there any user-facing changes?

No.

Closes #50579.

@GujaLomsadze
GujaLomsadze marked this pull request as ready for review July 22, 2026 18:41
@GujaLomsadze

Copy link
Copy Markdown
Contributor Author

@raulcd @rok @AlenkaF
small follow-up to #50543 - luckily, one-line test fix for the pandas 3.0.3
out-of-category Categorical deprecation that's failing nightly wheels (#50579).

Swept the codebase for the same pattern: this should be the only remaining unhandled place.
Ready for review, CI green.

@rok rok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is straightforward enough, thanks!

@github-actions github-actions Bot added awaiting merge Awaiting merge and removed awaiting review Awaiting review labels Jul 22, 2026
@rok

rok commented Jul 22, 2026

Copy link
Copy Markdown
Member

@github-actions crossbow submit wheel-macos-monterey-cp311-cp311-* wheel-manylinux-2-28-cp311-cp311-* wheel-musllinux-1-2-cp311-cp311-arm64 wheel-windows-*-amd64

@github-actions

Copy link
Copy Markdown

Revision: 73e1511

Submitted crossbow builds: ursacomputing/crossbow @ actions-726ee0454c

Task Status
wheel-macos-monterey-cp311-cp311-amd64 GitHub Actions
wheel-macos-monterey-cp311-cp311-arm64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-amd64 GitHub Actions
wheel-manylinux-2-28-cp311-cp311-arm64 GitHub Actions
wheel-musllinux-1-2-cp311-cp311-arm64 GitHub Actions
wheel-windows-cp311-cp311-amd64 GitHub Actions
wheel-windows-cp312-cp312-amd64 GitHub Actions
wheel-windows-cp313-cp313-amd64 GitHub Actions
wheel-windows-cp314-cp314-amd64 GitHub Actions
wheel-windows-cp314-cp314t-amd64 GitHub Actions

@rok

rok commented Jul 22, 2026

Copy link
Copy Markdown
Member

The failing wheel jobs are all due to simdjson work in progress. Merging!

@rok
rok merged commit 10cf43b into apache:main Jul 22, 2026
38 checks passed
@rok rok removed the awaiting merge Awaiting merge label Jul 22, 2026
@rok

rok commented Jul 22, 2026

Copy link
Copy Markdown
Member

Thanks for the quick fix @GujaLomsadze !

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Python] test_categorical_order_survives_roundtrip fails on wheels with Pandas Deprecation

2 participants