[Data] Compute Expressions-Expr Logarithmic#59549
[Data] Compute Expressions-Expr Logarithmic#59549richardliaw merged 2 commits intoray-project:masterfrom
Conversation
Signed-off-by: yaommen <myanstu@163.com>
There was a problem hiding this comment.
Code Review
This pull request adds logarithmic and exponential functions (ln, log10, log2, exp) to Ray Data expressions, which is a great addition. The implementation is clean and follows the existing pattern for wrapping PyArrow compute functions. The tests are also well-structured. I've found one important issue regarding the return type inference for these new functions when applied to integer columns, which could lead to incorrect schemas. I've provided a suggestion to fix this. I also recommended enhancing the tests to cover integer inputs to verify the fix and improve robustness. Overall, this is a solid contribution.
| expected_fn, | ||
| ): | ||
| """Test logarithmic and exponential expressions.""" | ||
| values = [1.0, math.e, 10.0, 4.0] |
There was a problem hiding this comment.
The current test cases only cover floating-point inputs. The issue I pointed out in expressions.py regarding return type inference is most apparent with integer inputs. To ensure the fix is properly validated and to prevent future regressions, it would be beneficial to add test coverage for integer inputs.
You could consider adding a separate test or parameterizing this one to run with a list of integers, for example [1, 10, 4, 2].
Signed-off-by: yaommen <myanstu@163.com>
|
Hi @goutamvenkat-anyscale , thanks again for yesterday’s review on [Data] Compute Expressions‑Expr Rounding (#59295). This PR is another part of your same issue #58674, and the changes closely follow what we did in the earlier PR. If you have time, could you take a look at this one as well? Thanks a lot! |
Signed-off-by: seanlaii <qazwsx0939059006@gmail.com>
Signed-off-by: jasonwrwang <jasonwrwang@tencent.com>
Signed-off-by: lee1258561 <lee1258561@gmail.com>
Signed-off-by: peterxcli <peterxcli@gmail.com>
Description
Completing the Expr (direct) Logarithmic operations (ln, log10, log2, exp)
test for example:
Related issues
Related to #58674
Related PR: #59295
Additional information