Skip to content

Commit 90d6251

Browse files
committed
move condition
1 parent 7c00c66 commit 90d6251

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/core/dtypes/cast.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,7 @@ def convert_dtypes(
11271127
or (
11281128
inferred_dtype.kind not in "iufcb"
11291129
and not isinstance(inferred_dtype, StringDtype)
1130+
and not isinstance(inferred_dtype, CategoricalDtype)
11301131
)
11311132
):
11321133
if isinstance(inferred_dtype, PandasExtensionDtype) and not isinstance(
@@ -1143,7 +1144,6 @@ def convert_dtypes(
11431144
base_dtype.kind == "O" # type: ignore[union-attr]
11441145
and input_array.size > 0
11451146
and isna(input_array).all()
1146-
and not isinstance(input_array.dtype, CategoricalDtype)
11471147
):
11481148
import pyarrow as pa
11491149

0 commit comments

Comments
 (0)