File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -359,6 +359,8 @@ def maybe_promote(dtype, fill_value=np.nan):
359359 if isinstance (fill_value , datetime ) and fill_value .tzinfo is not None :
360360 # Trying to insert tzaware into tznaive, have to cast to object
361361 dtype = np .dtype (np .object_ )
362+ elif is_integer (fill_value ) or (is_float (fill_value ) and not isna (fill_value )):
363+ dtype = np .dtype (np .object_ )
362364 else :
363365 try :
364366 fill_value = tslibs .Timestamp (fill_value ).to_datetime64 ()
Original file line number Diff line number Diff line change @@ -592,8 +592,6 @@ def test_maybe_promote_datetime64_with_any(
592592 else :
593593 if boxed and box_dtype is None :
594594 pytest .xfail ("does not upcast to object" )
595- if not boxed :
596- pytest .xfail ("does not upcast to object or raises" )
597595
598596 # create array of given dtype; casts "1" to correct dtype
599597 fill_value = np .array ([1 ], dtype = fill_dtype )[0 ]
You can’t perform that action at this time.
0 commit comments