Skip to content

Commit b29279f

Browse files
committed
TST: Update union_categorical tests
This relied on `NaN` being a float and empty being a float. Not a necessary test anymore.
1 parent 273e6c8 commit b29279f

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

pandas/tests/reshape/test_union_categoricals.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -107,17 +107,11 @@ def test_union_categoricals_empty(self):
107107
exp = Categorical([])
108108
tm.assert_categorical_equal(res, exp)
109109

110-
res = union_categoricals([pd.Categorical([]),
111-
pd.Categorical([1.0])])
112-
exp = Categorical([1.0])
110+
res = union_categoricals([Categorical([]),
111+
Categorical(['1'])])
112+
exp = Categorical(['1'])
113113
tm.assert_categorical_equal(res, exp)
114114

115-
# to make dtype equal
116-
nanc = pd.Categorical(np.array([np.nan], dtype=np.float64))
117-
res = union_categoricals([nanc,
118-
pd.Categorical([])])
119-
tm.assert_categorical_equal(res, nanc)
120-
121115
def test_union_categorical_same_category(self):
122116
# check fastpath
123117
c1 = Categorical([1, 2, 3, 4], categories=[1, 2, 3, 4])

0 commit comments

Comments
 (0)