fix(pydeck): Support pandas 3.x compatibility#9988
Merged
chrisgervang merged 2 commits intomasterfrom Feb 6, 2026
Merged
Conversation
… 2.x Replace module-based DataFrame detection with duck-typing to work with both pandas 2.x and 3.x module paths. Add defensive error handling in JSON serialization to prevent crashes from objects without __dict__. Includes additional tests for edge cases. Fixes #9986 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
felixpalmer
approved these changes
Feb 6, 2026
Collaborator
Author
felixpalmer
pushed a commit
that referenced
this pull request
Feb 10, 2026
… 2.x (#9988) Replace module-based DataFrame detection with duck-typing to work with both pandas 2.x and 3.x module paths. Add defensive error handling in JSON serialization to prevent crashes from objects without __dict__. Includes additional tests for edge cases. Fixes #9986 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
|
Didn't you forget to upload pydeck-9.2.7 to Pypi ? or is it waiting further testing ? |
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.

Closes #9986
Background
pydeck fails with pandas 3.x when calling
.to_json()due to two issues:__dict__attributeChange List
is_pandas_df()with duck-typing approach that works with both pandas 2.x and 3.xdefault_serialize()to handle objects without__dict__Note
Low Risk
Behavior changes are localized to DataFrame detection and JSON fallback serialization, with low risk of broader impact beyond how some objects are classified/serialized.
Overview
Fixes pandas 3.x compatibility issues in pydeck by switching
is_pandas_df()from module-path checks to a duck-typed DataFrame check (name + required methods), reducing false negatives across pandas versions.Hardens JSON rendering in
default_serialize()by safely handling objects without a__dict__: it now falls back toto_dict(orient="records")when available (e.g., DataFrames) and otherwise stringifies the object instead of raising. Adds tests covering negativeis_pandas_dfcases and validating the duck-typing behavior.Written by Cursor Bugbot for commit df07e92. This will update automatically on new commits. Configure here.