From 081217437a3d6445d6aa6511d9a5c92958a2cb63 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Sun, 1 Oct 2023 22:24:18 +0100 Subject: [PATCH] Fix --- pandas/core/dtypes/cast.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index fa1d5097971a3..d53478bc309b7 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1133,7 +1133,11 @@ def convert_dtypes( base_dtype = np.dtype(str) else: base_dtype = inferred_dtype - if base_dtype.kind == "O" and len(input_array) > 0 and isna(input_array).all(): + if ( + base_dtype.kind == "O" + and len(input_array) > 0 + and isna(input_array).all() + ): import pyarrow as pa pa_type = pa.null()