Skip to content

Commit 8d9f3f3

Browse files
authored
fix code too long
1 parent ccb363e commit 8d9f3f3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pandas/core/arrays/categorical.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,9 @@ def astype(self, dtype: ExtensionDtype, copy: bool = ...) -> ExtensionArray: ...
549549
@overload
550550
def astype(self, dtype: AstypeArg, copy: bool = ...) -> ArrayLike: ...
551551

552-
def astype(self, dtype: AstypeArg, copy: bool = True, errors: str = "raise") -> ArrayLike:
552+
def astype(
553+
self, dtype: AstypeArg, copy: bool = True, errors: str = "raise"
554+
) -> ArrayLike:
553555
"""
554556
Coerce this type to another dtype
555557
@@ -609,7 +611,9 @@ def astype(self, dtype: AstypeArg, copy: bool = True, errors: str = "raise") ->
609611
raise ValueError(msg) from err
610612

611613
if errors == "raise" and not np.all(np.isin(self.codes, new_cats)):
612-
raise ValueError("Cannot convert to CategoricalDtype with undefined values")
614+
raise ValueError(
615+
"Cannot convert to CategoricalDtype with undefined values"
616+
)
613617

614618
result = take_nd(
615619
new_cats, ensure_platform_int(self._codes), fill_value=fill_value

0 commit comments

Comments
 (0)