NVIDIA / NVIDIA/cudf

[FEA] Support missing operators in cudf.Series (`__divmod__`, `__rdivmod__`, `__round__`).

Open
#10,177 5 comments 1 reaction 0 assignees View on GitHub
feature request Python
Dominant language
C++
Stars
9.8k
Forks
1.1k
Avg merge
3d 6m
Merged PRs (30d)
278

Description

**Is your feature request related to a problem? Please describe.**
`cudf.Series` does not have reverse binary operators for bitwise operators like `__rxor__`. This was caught after changing the output of `Series.hash_values` from a `cupy.array` to a `cudf.Series` in #9390, which broke NVTabular: https://github.com/NVIDIA-Merlin/NVTabular/pull/1376#pullrequestreview-868327738. The `cupy.array` class supports both directions, like `array ^ scalar` and `scalar ^ array`. Similarly, pandas supports both directions. Currently `cudf.Series` only supports `series ^ scalar`.

**Describe the solution you'd like**
Add reverse binary operators for all cases that are missing, which include at least bitwise operators like `__rxor__` but possibly others as well. Missing operators have been addressed several times in the past (#208, #213, #1292, #8598, ...). Resolving this issue should involve checking the full list in the [Python object model documentation](https://docs.python.org/3/reference/datamodel.html#object.__radd__) to make sure we catch everything that pandas supports.

**Additional context**
A workaround is to use the binary operator in the reverse order (for commutative operators).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.