Skip to content

Commit a45c7fa

Browse files
author
Khor Chean Wei
authored
Unit Test: Construction of DataFrame works with empty list but not empty array (pandas-dev#47192)
1 parent c07a910 commit a45c7fa

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/frame/test_constructors.py

+6
Original file line numberDiff line numberDiff line change
@@ -3085,3 +3085,9 @@ def test_tzaware_data_tznaive_dtype(self, constructor):
30853085

30863086
assert np.all(result.dtypes == "M8[ns]")
30873087
assert np.all(result == ts_naive)
3088+
3089+
def test_construction_empty_array_multi_column_raises(self):
3090+
# GH#46822
3091+
msg = "Empty data passed with indices specified."
3092+
with pytest.raises(ValueError, match=msg):
3093+
DataFrame(data=np.array([]), columns=["a", "b"])

0 commit comments

Comments
 (0)