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

[BUG] list contains requires passing a device scalar #7854

Closed
beckernick opened this issue Apr 5, 2021 · 0 comments · Fixed by #7864
Closed

[BUG] list contains requires passing a device scalar #7854

beckernick opened this issue Apr 5, 2021 · 0 comments · Fixed by #7864
Assignees
Labels
bug Something isn't working Python Affects Python cuDF API.

Comments

@beckernick
Copy link
Member

beckernick commented Apr 5, 2021

In the 2021-04-05 nightly, list.contains currently requires explicitly passing a device scalar. We should create the device scalar under the hood if it's required by the routine.

import cudfdf = cudf.DataFrame({"a":[[0,1],[1,2]]})
df.a.list.contains(cudf.Scalar(2)) # works
df.a.list.contains(2)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-9ed499d3bea5> in <module>
      3 df = cudf.DataFrame({"a":[[0,1],[1,2]]})
      4 df.a.list.contains(cudf.Scalar(2)) # works
----> 5 df.a.list.contains(2)

/raid/nicholasb/miniconda3/envs/rapids-gpubdb-20210405/lib/python3.7/site-packages/cudf/core/column/lists.py in contains(self, search_key)
    240         try:
    241             res = self._return_or_inplace(
--> 242                 contains_scalar(self._column, search_key.device_value)
    243             )
    244         except RuntimeError as e:

AttributeError: 'int' object has no attribute 'device_value'
conda list | grep "rapids\|numpy\|cupy"
# packages in environment at /raid/nicholasb/miniconda3/envs/rapids-gpubdb-20210405:
cudf                      0.19.0a210405   cuda_10.2_py37_g73638bbfea_343    rapidsai-nightly
cuml                      0.19.0a210405   cuda10.2_py37_g4bf0ba4da_152    rapidsai-nightly
cupy                      8.6.0            py37h7fc54ca_0    conda-forge
dask-cuda                 0.19.0a210405           py37_46    rapidsai-nightly
dask-cudf                 0.19.0a210405   py37_g73638bbfea_343    rapidsai-nightly
libcudf                   0.19.0a210405   cuda10.2_g73638bbfea_343    rapidsai-nightly
libcuml                   0.19.0a210405   cuda10.2_g4bf0ba4da_152    rapidsai-nightly
libcumlprims              0.19.0a210402   cuda10.2_g8859156_34    rapidsai-nightly
librmm                    0.19.0a210405   cuda10.2_gbefea87_53    rapidsai-nightly
numpy                     1.19.5           py37haa41c4c_1    conda-forge
rmm                       0.19.0a210405   cuda_10.2_py37_gbefea87_53    rapidsai-nightly
ucx                       1.9.0+gcd9efd3       cuda10.2_0    rapidsai-nightly
ucx-proc                  1.0.0                       gpu    rapidsai-nightly
ucx-py                    0.19.0a210405   py37_gcd9efd3_47    rapidsai-nightly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Python Affects Python cuDF API.
Projects
None yet
2 participants