Skip to content

Commit b7ab155

Browse files
authored
fix testcase issue
1 parent 537671a commit b7ab155

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/core/construction.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,10 @@ def sanitize_array(
612612
if dtype is None:
613613
subarr = data
614614
if data.dtype == object and infer_object:
615-
fltarr = data.ravel() # GH#61026
616-
subarr = maybe_infer_to_datetimelike(fltarr)
615+
if data.ndim != 1:
616+
# GH#61026
617+
subarr = data.ravel()
618+
subarr = maybe_infer_to_datetimelike(subarr)
617619
elif data.dtype.kind == "U" and using_string_dtype():
618620
from pandas.core.arrays.string_ import StringDtype
619621

0 commit comments

Comments
 (0)