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

[gpuCI] Forward-merge branch-22.10 to branch-22.12 [skip gpuci] #11820

Merged
merged 1 commit into from
Sep 29, 2022

Conversation

GPUtester
Copy link
Collaborator

Forward-merge triggered by push to branch-22.10 that creates a PR to keep branch-22.12 up-to-date. If this PR is unable to be immediately merged due to conflicts, it will remain open for the team to manually merge.

Root cause:
```python
In [1]: import numpy as np

In [2]: x = np.uint8(1)

In [3]: y = np.float64(1.0)

In [4]: x.__ge__(y)
Out[4]: NotImplemented

In [8]: x >= y
Out[8]: True
```
This is leading to the following error whenever there is a Scalar binary operation involved:
```python
python/cudf/cudf/tests/test_series.py:449: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../envs/cudfdev/lib/python3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/series.py:2988: in describe
    data = _describe_categorical(self, percentiles)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/series.py:152: in _describe_categorical
    val_counts = obj.value_counts(ascending=False)
../envs/cudfdev/lib/python3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/series.py:2862: in value_counts
    res = res.sort_values(ascending=ascending)
../envs/cudfdev/lib/python3.9/contextlib.py:79: in inner
    return func(*args, **kwds)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/series.py:1910: in sort_values
    return super().sort_values(
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/indexed_frame.py:1916: in sort_values
    out = self._gather(
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/indexed_frame.py:1523: in _gather
    if not libcudf.copying._gather_map_is_valid(
copying.pyx:67: in cudf._lib.copying._gather_map_is_valid
    ???
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/mixins/mixin_factory.py:11: in wrapper
    return method(self, *args1, *args2, **kwargs1, **kwargs2)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:350: in _binaryop
    return Scalar(result, dtype=out_dtype)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:56: in __call__
    obj = super().__call__(value, dtype=dtype)
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:128: in __init__
    self._host_value, self._host_dtype = self._preprocess_host_value(
../envs/cudfdev/lib/python3.9/site-packages/cudf/core/scalar.py:222: in _preprocess_host_value
    value = to_cudf_compatible_scalar(value, dtype=dtype)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

val = NotImplemented, dtype = <class 'numpy.bool_'>

    def to_cudf_compatible_scalar(val, dtype=None):
        """
        Converts the value `val` to a numpy/Pandas scalar,
        optionally casting to `dtype`.
    
        If `val` is None, returns None.
        """
    
        if cudf._lib.scalar._is_null_host_scalar(val) or isinstance(
            val, cudf.Scalar
        ):
            return val
    
        if not cudf.api.types._is_scalar_or_zero_d_array(val):
>           raise ValueError(
                f"Cannot convert value of type {type(val).__name__} "
                "to cudf scalar"
            )
E           ValueError: Cannot convert value of type NotImplementedType to cudf scalar

../envs/cudfdev/lib/python3.9/site-packages/cudf/utils/dtypes.py:248: ValueError
```
This PR fixes the issue by first trying to call the `op` with `operator` standard library and then try to `getattr` if the `op` is not found in `operator` module.

Authors:
  - GALI PREM SAGAR (https://github.com/galipremsagar)

Approvers:
  - Lawrence Mitchell (https://github.com/wence-)
  - https://github.com/brandon-b-miller

URL: #11816
@GPUtester GPUtester requested a review from a team as a code owner September 29, 2022 13:25
@GPUtester GPUtester merged commit 90afe92 into branch-22.12 Sep 29, 2022
@GPUtester
Copy link
Collaborator Author

SUCCESS - forward-merge complete.

@github-actions github-actions bot added the Python Affects Python cuDF API. label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants