10000 REGR: fix return class in _constructor_from_mgr for simple subclasses by ivirshup · Pull Request #55764 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

REGR: fix return class in _constructor_from_mgr for simple subclasses #55764

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

Next Next commit
Revert _constructor check
  • Loading branch information
ivirshup committed Oct 30, 2023
commit dc210b60df8e3fbed542377d382fc71cfbf2b40f
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,7 @@ def _constructor(self) -> Callable[..., DataFrame]:
return DataFrame

def _constructor_from_mgr(self, mgr, axes):
if self._constructor is DataFrame:
if type(self) is DataFrame:
# we are pandas.DataFrame (or a subclass that doesn't override _constructor)
return self._from_mgr(mgr, axes=axes)
else:
Expand Down
0