Skip to content

Commit 5436b1d

Browse files
committed
update assert_equal for check_dtype
1 parent 1fc1a7e commit 5436b1d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pandas/util/testing.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,12 @@ def assert_series_equal(left, right, check_dtype=True,
12441244
obj='{obj}.index'.format(obj=obj))
12451245

12461246
if check_dtype:
1247-
assert_attr_equal('dtype', left, right)
1247+
if (is_categorical_dtype(left) and is_categorical_dtype(right) and
1248+
not check_categorical):
1249+
# compat with pandas 0.21.0 CategoricalDtype
1250+
pass
1251+
else:
1252+
assert_attr_equal('dtype', left, right)
12481253

12491254
if check_exact:
12501255
assert_numpy_array_equal(left.get_values(), right.get_values(),

0 commit comments

Comments
 (0)