-
Notifications
You must be signed in to change notification settings - Fork 62
feat: implement cos, sin, and log operations for polars compiler #2170
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
Conversation
| ) -> pl.Expr: | ||
| import polars as pl | ||
|
|
||
| return pl.when(input < -1).then(float("nan")).otherwise((input + 1).log()) |
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.
not input <= -1 and likewise for other log ops?
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.
Good catch. log(0) is out of the domain. I have also updated this in the SQLGlot implementation that inspired this.
| ) -> pl.Expr: | ||
| import polars as pl | ||
|
|
||
| return pl.when(input <= 0).then(float("nan")).otherwise(input.sqrt()) |
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.
seems sqrt 0 should be 0, not nan?
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.
Yep. Just pushed some commits fixing.
|
Samples failure: e2e failures: timeout on tests/system/large/functions/test_remote_function.py::test_remote_function_unnamed_removed_w_session_cleanup These seem unrelated to my change. |
Towards #2147 (using Polars in more doctests) 🦕