REF: remove GeoDataFrame shim in _constructor_from_mgr#65175
Merged
jorisvandenbossche merged 2 commits intopandas-dev:mainfrom Apr 15, 2026
Merged
REF: remove GeoDataFrame shim in _constructor_from_mgr#65175jorisvandenbossche merged 2 commits intopandas-dev:mainfrom
jorisvandenbossche merged 2 commits intopandas-dev:mainfrom
Conversation
Remove dead GeoDataFrame name-check shim in DataFrame._constructor_from_mgr since geopandas has overridden _constructor_from_mgr directly since v0.14.3 (Jan 2024). Remove _constructor_expanddim_from_mgr and inline its logic into Series.to_frame(), its only call site. Subclasses that need custom expand-dim behavior can override to_frame directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
|
Removing the GeoDataFrame check should be fine now indeed. Removing |
Member
Author
Let's have this argument back in the linked issue. I'll revert this part for this PR. |
Revert the inlining of _constructor_expanddim_from_mgr; downstream subclasses (spatialpandas, timely-beliefs, autogluon, etc.) override the _from_mgr methods and would break if they were removed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jorisvandenbossche
approved these changes
Apr 15, 2026
Member
|
Thanks! |
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.
Summary
GeoDataFramename-check shim inDataFrame._constructor_from_mgr— geopandas has overridden_constructor_from_mgrdirectly since v0.14.3 (Jan 2024)Remove_constructor_expanddim_from_mgrand inline its logic intoSeries.to_frame(), its only call sitePart of #56681.
Test plan
pandas/tests/series/methods/test_to_frame.py— passespandas/tests/frame/test_subclass.py— passespandas/tests/series/test_subclass.py— passes🤖 Generated with Claude Code