Skip to content

Commit e3ef043

Browse files
committed
update assert_equal for check_dtype
1 parent 2652d28 commit e3ef043

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
@@ -1239,7 +1239,12 @@ def assert_series_equal(left, right, check_dtype=True,
12391239
obj='{0}.index'.format(obj))
12401240

12411241
if check_dtype:
1242-
assert_attr_equal('dtype', left, right)
1242+
if (is_categorical_dtype(left) and is_categorical_dtype(right) and
1243+
not check_categorical):
1244+
# compat with pandas 0.21.0 CategoricalDtype
1245+
pass
1246+
else:
1247+
assert_attr_equal('dtype', left, right)
12431248

12441249
if check_exact:
12451250
assert_numpy_array_equal(left.get_values(), right.get_values(),

0 commit comments

Comments
 (0)