Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from pandas.core.dtypes.common import (
ensure_int64,
ensure_object,
ensure_platform_int,
is_categorical_dtype,
is_datetime64_dtype,
is_dict_like,
Expand Down Expand Up @@ -533,7 +534,7 @@ def astype(self, dtype: Dtype, copy: bool = True) -> ArrayLike:
# error: Incompatible types in assignment (expression has type "ndarray",
# variable has type "Categorical")
result = take_nd( # type: ignore[assignment]
new_cats, libalgos.ensure_platform_int(self._codes)
new_cats, ensure_platform_int(self._codes)
)

return result
Expand Down
2 changes: 0 additions & 2 deletions pandas/tests/apply/test_frame_transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ def test_transform_method_name(method):
frame_kernels_raise = [x for x in frame_transform_kernels if x not in wont_fail]


# mypy doesn't allow adding lists of different types
# https://github.com/python/mypy/issues/5492
@pytest.mark.parametrize("op", [*frame_kernels_raise, lambda x: x + 1])
def test_transform_bad_dtype(op, frame_or_series):
# GH 35964
Expand Down