You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By contrast, if we do cat.astype("category") we do retain orderedness.
Found when refactoring sanitize_array. We have two code paths effectively:
if isinstance(data, ExtensionArray):
if dtype is not None:
return data.astype(dtype, copy=copy)
elif copy:
return data.copy()
return data
if isinstance(dtype, ExtensionDtype):
cls = dtype.construct_array_type()
return cls._from_sequence(data, dtype=dtype, copy=copy)
Switching the order of these checks causes a few Categorical tests to break bc of the Categorical constructor behavior.
The text was updated successfully, but these errors were encountered:
By contrast, if we do
cat.astype("category")
we do retain orderedness.Found when refactoring
sanitize_array
. We have two code paths effectively:Switching the order of these checks causes a few Categorical tests to break bc of the Categorical constructor behavior.
The text was updated successfully, but these errors were encountered: