Skip to content

Commit 437a322

Browse files
author
adrien pacifico
committed
add tests
1 parent 6537afe commit 437a322

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

pandas/tests/dtypes/test_concat.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pandas.core.dtypes.concat as _concat
44

55
import pandas as pd
6-
from pandas import Series
6+
from pandas import Series, DataFrame
77
import pandas._testing as tm
88

99

@@ -64,3 +64,21 @@ def test_concat_series_between_empty_and_tzaware_series(using_infer_string):
6464
dtype=float,
6565
)
6666
tm.assert_frame_equal(result, expected)
67+
68+
69+
def test_concat_categorical_dataframes():
70+
df = DataFrame({"a": [0, 1]}, dtype="category")
71+
df2 = DataFrame({"a": [2, 3]}, dtype="category")
72+
73+
result = pd.concat([df, df2], axis=0)
74+
75+
assert result["a"].dtype.name == "category"
76+
77+
78+
def test_concat_categorical_series():
79+
ser = Series([0, 1], dtype="category")
80+
ser2 = Series([2, 3], dtype="category")
81+
82+
result = pd.concat([ser, ser2], axis=0)
83+
84+
assert result.dtype.name == "category"

0 commit comments

Comments
 (0)