diff --git a/python/cudf/cudf/tests/test_doctests.py b/python/cudf/cudf/tests/test_doctests.py index 0acc374b7e1..794660cffcb 100644 --- a/python/cudf/cudf/tests/test_doctests.py +++ b/python/cudf/cudf/tests/test_doctests.py @@ -8,6 +8,7 @@ import numpy as np import pytest +from packaging import version import cudf @@ -84,7 +85,7 @@ def chdir_to_tmp_path(cls, tmp_path): def prinoptions(cls): # TODO: NumPy now prints scalars as `np.int8(1)`, etc. this should # be adapted evantually. - if np.lib.NumpyVersion(np.__version__) >= "2.0.0rc1": + if version.parse(np.__version__) >= version.parse("2.0"): with np.printoptions(legacy="1.25"): yield else: