Skip to content

Commit

Permalink
Silence warning from pandas.testing.assert_series_equal.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdice committed Feb 3, 2022
1 parent 2c3c87e commit 99006ce
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion python/cudf/cudf/testing/_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Copyright (c) 2020-2021, NVIDIA CORPORATION.

import re
import warnings
from collections.abc import Mapping, Sequence
from contextlib import contextmanager
from decimal import Decimal
Expand Down Expand Up @@ -109,7 +110,15 @@ def assert_eq(left, right, **kwargs):
if isinstance(left, pd.DataFrame):
tm.assert_frame_equal(left, right, **kwargs)
elif isinstance(left, pd.Series):
tm.assert_series_equal(left, right, **kwargs)
# TODO: A warning is emitted from the function
# pandas.testing.assert_series_equal for some inputs:
# "DeprecationWarning: elementwise comparison failed; this will raise
# an error in the future."
# This warning comes from a call from pandas to numpy. It is ignored
# here because it cannot be fixed within cudf.
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
tm.assert_series_equal(left, right, **kwargs)
elif isinstance(left, pd.Index):
tm.assert_index_equal(left, right, **kwargs)
elif isinstance(left, np.ndarray) and isinstance(right, np.ndarray):
Expand Down

0 comments on commit 99006ce

Please sign in to comment.