Skip to content

[FEA] cudf::contains(column, column) should be consistent with other contains() APIs #10725

Closed

Description

@ttnghia

Currently (and typically) the parameters of the contains() API should be given in the following order:

  1. Search space
  2. Value to search for

Such order is maintained in many places such as lists::contains and cudf::contains(column, scalar). However, the overload of cudf::contains(column, column) requires the input to be given in the opposite order. In particular, it requires cudf::contains(values to search for, search space). This makes it inconsistent with the other contains APIs and may lead to confusion.

In addition, the parameter names of that overload are called as:

contains(
  column_view const& haystack,
  column_view const& needles,

That means, it searches for "haystack" in a pile of "needles". This is wrong by nature.

Activity

  1. added
    feature request
    Needs Triage
    on Apr 25, 2022
  2. jrhemstad commented on Apr 25, 2022

    @jrhemstad
    Contributor

    https://github.com/rapidsai/cudf/blob/75f3873b87af8871c4fb85077df3dba4bbe24e2a/cpp/include/cudf/search.hpp#L140-L167

    In addition, the parameter names of that overload are called as:

    contains(
      column_view const& haystack,
      column_view const& needles,
    

    That means, it searches for "haystack" in a pile of "needle". This is wrong by nature.

    That's so ridiculous I thought it surely couldn't be true, but it is 😢

    Can't believe this made it through code review #3427 (comment)

    This should definitely be remedied.

  3. self-assigned this
    on Apr 28, 2022
  4. removed
    Needs Triage
    on Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions