From cb90e32330eae1c4e693af35c0dec270c1571920 Mon Sep 17 00:00:00 2001 From: arw2019 Date: Sun, 11 Oct 2020 17:10:34 +0000 Subject: [PATCH] feedback: add assert to maybe_castable --- pandas/core/dtypes/cast.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandas/core/dtypes/cast.py b/pandas/core/dtypes/cast.py index fdaff66a4f50a..3797e28f63e80 100644 --- a/pandas/core/dtypes/cast.py +++ b/pandas/core/dtypes/cast.py @@ -1286,6 +1286,8 @@ def convert_dtypes( def maybe_castable(arr: np.ndarray) -> bool: # return False to force a non-fastpath + assert isinstance(arr, np.ndarray) # GH 37024 + # check datetime64[ns]/timedelta64[ns] are valid # otherwise try to coerce kind = arr.dtype.kind