Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declare a different name for nan_equality.UNEQUAL to prevent Cython warnings. #12947

Merged
merged 2 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/cudf/cudf/_lib/cpp/types.pxd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2020-2022, NVIDIA CORPORATION.
# Copyright (c) 2020-2023, NVIDIA CORPORATION.

from libc.stdint cimport int32_t, uint32_t

Expand Down Expand Up @@ -47,8 +47,10 @@ cdef extern from "cudf/types.hpp" namespace "cudf" nogil:
UNEQUAL "cudf::null_equality::UNEQUAL"

ctypedef enum nan_equality "cudf::nan_equality":
# These names differ from the C++ names due to Cython warnings if
# "UNEQUAL" is declared by both null_equality and nan_equality.
ALL_EQUAL "cudf::nan_equality::ALL_EQUAL"
UNEQUAL "cudf::nan_equality::UNEQUAL"
NANS_UNEQUAL "cudf::nan_equality::UNEQUAL"

ctypedef enum type_id "cudf::type_id":
EMPTY "cudf::type_id::EMPTY"
Expand Down
4 changes: 2 additions & 2 deletions python/cudf/cudf/_lib/lists.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2021-2022, NVIDIA CORPORATION.
# Copyright (c) 2021-2023, NVIDIA CORPORATION.

from cudf.core.buffer import acquire_spill_lock

Expand Down Expand Up @@ -84,7 +84,7 @@ def distinct(Column col, bool nulls_equal, bool nans_all_equal):
null_equality.EQUAL if nulls_equal else null_equality.UNEQUAL
)
cdef nan_equality c_nans_equal = (
nan_equality.ALL_EQUAL if nans_all_equal else nan_equality.UNEQUAL
nan_equality.ALL_EQUAL if nans_all_equal else nan_equality.NANS_UNEQUAL
)

cdef unique_ptr[column] c_result
Expand Down