-
Notifications
You must be signed in to change notification settings - Fork 879
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
Fixes for numpy 1.23.0 #2137
Fixes for numpy 1.23.0 #2137
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2137 +/- ##
=======================================
Coverage 99.21% 99.21%
=======================================
Files 143 143
Lines 16833 16835 +2
=======================================
+ Hits 16701 16703 +2
Misses 132 132
Continue to review full report at Codecov.
|
@@ -881,7 +881,10 @@ def __init__(self, commutative=False): | |||
self.commutative = commutative | |||
|
|||
def get_function(self): | |||
return np.divide | |||
def divide_numeric(val1, val2): |
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.
When primitives directly return a function, it tends to be faster. Is there no way to keep using np.divide
?
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.
Fixes for numpy 1.23.0
Implement fixes for compatibility with numpy 1.23.0
With numpy 1.23.0 the
np.divide
function used in theDivideNumeric
primitive now generates an error with pyspark inputs.To resolve, the primitive was updated to divide the two series directly rather than using the np.divide function.
Also had to update the doctest for the
NaturalLogarithm
primitive to round primitive output to account for slightly different floating point output with the new version of numpy.