File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -1133,21 +1133,12 @@ def maybe_convert_dtypes(
11331133 b boolean
11341134 dtype: object
11351135 """
1136- obj_any = cast ("Any" , obj )
1137- native_obj = obj_any .to_native ()
1138- if is_pandas_like_dataframe (native_obj ):
1139- return obj_any ._with_compliant (
1140- obj_any ._compliant_frame ._with_native (
1141- native_obj .convert_dtypes (* args , ** kwargs )
1142- )
1143- )
1144- if is_pandas_like_series (native_obj ):
1145- return obj_any ._with_compliant (
1146- obj_any ._compliant_series ._with_native (
1147- native_obj .convert_dtypes (* args , ** kwargs )
1148- )
1149- )
1150- return obj_any
1136+ if not obj .implementation .is_pandas_like ():
1137+ return obj
1138+ result = obj ._with_compliant (
1139+ obj ._compliant ._with_native (obj .to_native ().convert_dtypes (* args , ** kwargs ))
1140+ )
1141+ return cast ("FrameOrSeriesT" , result )
11511142
11521143
11531144def scale_bytes (sz : int , unit : SizeUnit ) -> int | float :
You can’t perform that action at this time.
0 commit comments