@@ -2436,3 +2436,33 @@ def test_dt64arr_addsub_object_dtype_2d():
2436
2436
2437
2437
assert result2 .shape == (4 , 1 )
2438
2438
assert all (td ._value == 0 for td in result2 .ravel ())
2439
+
2440
+
2441
+ def test_concat_float_datetime64 ():
2442
+ # GH#32934
2443
+ df_time = pd .DataFrame ({"A" : pd .array (["2000" ], dtype = "datetime64[ns]" )})
2444
+ df_float = pd .DataFrame ({"A" : pd .array ([1.0 ], dtype = "float64" )})
2445
+
2446
+ expected = pd .DataFrame (
2447
+ {
2448
+ "A" : [
2449
+ pd .array (["2000" ], dtype = "datetime64[ns]" )[0 ],
2450
+ pd .array ([1.0 ], dtype = "float64" )[0 ],
2451
+ ]
2452
+ },
2453
+ index = [0 , 0 ],
2454
+ )
2455
+ result = pd .concat ([df_time , df_float ])
2456
+ tm .assert_frame_equal (expected , result )
2457
+
2458
+ expected = pd .DataFrame ({"A" : pd .array ([], dtype = "object" )})
2459
+ result = pd .concat ([df_time .iloc [:0 ], df_float .iloc [:0 ]])
2460
+ tm .assert_frame_equal (expected , result )
2461
+
2462
+ expected = pd .DataFrame ({"A" : pd .array ([1.0 ], dtype = "object" )})
2463
+ result = pd .concat ([df_time .iloc [:0 ], df_float ])
2464
+ tm .assert_frame_equal (expected , result )
2465
+
2466
+ expected = pd .DataFrame ({"A" : pd .array (["2000" ], dtype = "datetime64[ns]" )})
2467
+ result = pd .concat ([df_time , df_float .iloc [:0 ]])
2468
+ tm .assert_frame_equal (expected , result )
0 commit comments