Skip to content

Commit 9d8b79b

Browse files
committed
Revert _constructor call
Using `x._constructor` over `type(x)` causes dtype issues on 32 bit builds. Revert for now, since this is unrelated to current effort.
1 parent 26499e5 commit 9d8b79b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/groupby/ops.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ def _chop(self, sdata: Series, slice_obj: slice) -> Series:
929929
# fastpath equivalent to `sdata.iloc[slice_obj]`
930930
mgr = sdata._mgr.get_slice(slice_obj)
931931
# __finalize__ not called here, must be applied by caller if applicable
932-
return sdata._constructor(mgr, name=sdata.name, fastpath=True)
932+
return type(sdata)(mgr, name=sdata.name, fastpath=True)
933933

934934

935935
class FrameSplitter(DataSplitter):
@@ -946,7 +946,7 @@ def _chop(self, sdata: DataFrame, slice_obj: slice) -> DataFrame:
946946
# return sdata.iloc[:, slice_obj]
947947
mgr = sdata._mgr.get_slice(slice_obj, axis=1 - self.axis)
948948
# __finalize__ not called here, must be applied by caller if applicable
949-
return sdata._constructor(mgr)
949+
return type(sdata)(mgr)
950950

951951

952952
def get_splitter(

0 commit comments

Comments
 (0)