-
Notifications
You must be signed in to change notification settings - Fork 868
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
[REVIEW] Fix operator NotImplemented
issue with numpy
#11816
[REVIEW] Fix operator NotImplemented
issue with numpy
#11816
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## branch-22.10 #11816 +/- ##
===============================================
Coverage ? 87.51%
===============================================
Files ? 133
Lines ? 21807
Branches ? 0
===============================================
Hits ? 19085
Misses ? 2722
Partials ? 0 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add a test, for example:
diff --git a/python/cudf/cudf/tests/test_scalar.py b/python/cudf/cudf/tests/test_scalar.py
index 90268ebabe..1d7c09c70d 100644
--- a/python/cudf/cudf/tests/test_scalar.py
+++ b/python/cudf/cudf/tests/test_scalar.py
@@ -412,6 +412,13 @@ def test_datetime_scalar_from_string(data, dtype):
assert expected == slr.value
+def test_scalar_numpy_casting():
+ # binop should upcast to wider type
+ s1 = cudf.Scalar(1, dtype=np.int32)
+ s2 = np.int64(2)
+ assert s1 < s2
+
+
def test_scalar_cache():
s = cudf.Scalar(1)
s2 = cudf.Scalar(1)
Done 👍 |
@gpucibot merge |
## Description Because of the issue discovered here: #11816, we would like to pin the max version of `numpy` to `<1.23` thus averting the same error in `22.08`. ## Checklist - [x] I am familiar with the [Contributing Guidelines](https://github.com/rapidsai/cudf/blob/HEAD/CONTRIBUTING.md). - [x] New or existing tests cover these changes. - [x] The documentation is up to date with these changes. Authors: - GALI PREM SAGAR (https://github.com/galipremsagar) Approvers: - Ray Douglass (https://github.com/raydouglass)
Description
Root cause:
This is leading to the following error whenever there is a Scalar binary operation involved:
This PR fixes the issue by first trying to call the
op
withoperator
standard library and then try togetattr
if theop
is not found inoperator
module.Checklist