Skip to content
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

REGR: from_records not initializing subclasses properly #58145

Closed
wants to merge 1 commit into from

Conversation

phofl
Copy link
Member

@phofl phofl commented Apr 4, 2024

cc @jbrockmendel would appreciate thoughts, we don't have access to _constructor_from_mgr, so we need a workaround somehow.

@phofl phofl added the Regression Functionality that used to work in a prior pandas version label Apr 4, 2024
@phofl phofl added this to the 2.2.2 milestone Apr 4, 2024
@@ -2302,7 +2302,8 @@ def maybe_reorder(
columns = columns.drop(exclude)

mgr = arrays_to_mgr(arrays, columns, result_index)
return cls._from_mgr(mgr, axes=mgr.axes)
result = cls._from_mgr(mgr, axes=mgr.axes)
Copy link
Member

Choose a reason for hiding this comment

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

df = DataFrame._from_mgr(...)
if cls is not DataFrame:
     return cls(df, copy=False)
return df

@lithomas1 lithomas1 modified the milestones: 2.2.2, 2.2.3 Apr 11, 2024
Copy link
Contributor

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 12, 2024
@mroeschke
Copy link
Member

Closing to clear the queue, but feel free to update and reopen anytime

@mroeschke mroeschke closed this Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Functionality that used to work in a prior pandas version Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REGR: DataFrame.from_records for subclasses no longer calls subclass constructor
4 participants