Skip to content

Add support for pandas 3.0 class names#1877

Merged
t-kalinowski merged 2 commits intomainfrom
fix/pandas-3-compatibility
Jan 29, 2026
Merged

Add support for pandas 3.0 class names#1877
t-kalinowski merged 2 commits intomainfrom
fix/pandas-3-compatibility

Conversation

@dfalbel
Copy link
Member

@dfalbel dfalbel commented Jan 29, 2026

Summary

  • Adds S3 method registrations for pandas 3.0's shorter class names (e.g., pandas.DataFrame instead of pandas.core.frame.DataFrame)
  • Fixes string column conversion for pandas 3.0 which no longer accepts the second argument in the StringArray constructor
  • Maintains backwards compatibility with older pandas versions

Fixes #1875
Fixes #1874

🤖 Generated with Claude Code

Pandas 3.0 uses shorter class names (e.g., `pandas.DataFrame` instead of
`pandas.core.frame.DataFrame`). This adds S3 method registrations and
class checks for the new names while maintaining backwards compatibility
with older pandas versions.

Also fixes string column conversion for pandas 3.0 which no longer
accepts the second argument in the StringArray constructor.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
PyObjectPtr args(PyTuple_New(2));
PyObjectPtr args(PyTuple_New(1));
PyTuple_SetItem(args, 0, (PyObject*)r_to_py_numpy(column, convert));
PyTuple_SetItem(args, 1, Py_False);
Copy link
Member Author

Choose a reason for hiding this comment

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

This used to reference the copy argument, which defaults to False and became a keyword argument in v3. We can simply not pass it

@dfalbel dfalbel requested a review from t-kalinowski January 29, 2026 15:31
Copy link
Member

@t-kalinowski t-kalinowski left a comment

Choose a reason for hiding this comment

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

LGTM!

Can you please add a NEWS entry?

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@dfalbel
Copy link
Member Author

dfalbel commented Jan 29, 2026

Ok, just added the NEWS bullets

@t-kalinowski t-kalinowski merged commit 0ce0b74 into main Jan 29, 2026
13 checks passed
@t-kalinowski
Copy link
Member

Thank you!

@t-kalinowski t-kalinowski deleted the fix/pandas-3-compatibility branch January 29, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pandas DataFrame not converting to R data.frame Update for pandas 3.0.0

2 participants