diff --git a/python/cudf/cudf/core/df_protocol.py b/python/cudf/cudf/core/df_protocol.py index 8f258ce27b2..0f0cce283f3 100644 --- a/python/cudf/cudf/core/df_protocol.py +++ b/python/cudf/cudf/core/df_protocol.py @@ -1,3 +1,5 @@ +# Copyright (c) 2021-2022, NVIDIA CORPORATION. + import collections import enum from typing import ( diff --git a/python/cudf/cudf/tests/test_df_protocol.py b/python/cudf/cudf/tests/test_df_protocol.py index d24c8ca2860..2f851e805b4 100644 --- a/python/cudf/cudf/tests/test_df_protocol.py +++ b/python/cudf/cudf/tests/test_df_protocol.py @@ -1,3 +1,5 @@ +# Copyright (c) 2021-2022, NVIDIA CORPORATION. + from typing import Any, Tuple import cupy as cp @@ -27,13 +29,19 @@ def assert_buffer_equal(buffer_and_dtype: Tuple[_CuDFBuffer, Any], cudfcol): ) # check that non null values are the equals as nulls are represented # by sentinel values in the buffer. - non_null_idxs = cudf.Series(cudfcol) != cudf.NA + # FIXME: In gh-10202 some minimal fixes were added to unblock CI. But + # currently only non-null values are compared, null positions are + # unchecked. + non_null_idxs = ~cudf.Series(cudfcol).isna() assert_eq(col_from_buf[non_null_idxs], cudfcol[non_null_idxs]) if dtype[0] != _DtypeKind.BOOL: - array_from_dlpack = cp.fromDlpack(buf.__dlpack__()) - col_array = cp.asarray(cudfcol.data_array_view) - assert_eq(array_from_dlpack.flatten(), col_array.flatten()) + array_from_dlpack = cp.fromDlpack(buf.__dlpack__()).get() + col_array = cp.asarray(cudfcol.data_array_view).get() + assert_eq( + array_from_dlpack[non_null_idxs.to_numpy()].flatten(), + col_array[non_null_idxs.to_numpy()].flatten(), + ) else: pytest.raises(TypeError, buf.__dlpack__)