Skip to content

Commit d64785d

Browse files
authored
add test for concating tzaware series with empty series. Issue: #34174 (#56685)
1 parent 0c23e18 commit d64785d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pandas/tests/dtypes/test_concat.py

+17
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,20 @@ def test_concat_periodarray_2d():
4949

5050
with pytest.raises(ValueError, match=msg):
5151
_concat.concat_compat([arr[:2], arr[2:]], axis=1)
52+
53+
54+
def test_concat_series_between_empty_and_tzaware_series():
55+
tzaware_time = pd.Timestamp("2020-01-01T00:00:00+00:00")
56+
ser1 = Series(index=[tzaware_time], data=0, dtype=float)
57+
ser2 = Series(dtype=float)
58+
59+
result = pd.concat([ser1, ser2], axis=1)
60+
expected = pd.DataFrame(
61+
data=[
62+
(0.0, None),
63+
],
64+
index=pd.Index([tzaware_time], dtype=object),
65+
columns=[0, 1],
66+
dtype=float,
67+
)
68+
tm.assert_frame_equal(result, expected)

0 commit comments

Comments
 (0)