chore: migrate 10 scalar operators to SQLGlot#1922
Conversation
Migrated cos, hash, isnull, notnull, and sin operators.
Migrated tan_op, arcsin_op, arccos_op, arctan_op, and sinh_op scalar operators to SQLGlot.
| sge.If( | ||
| this=sge.func("ABS", expr.expr) > sge.convert(1), | ||
| true=sge.func("IEEE_DIVIDE", sge.convert(0), sge.convert(0)), | ||
| ) | ||
| ], |
There was a problem hiding this comment.
We might want to add some comments on the necessity of this check.
There was a problem hiding this comment.
Using _NAN instead for better readability.
| ifs=[ | ||
| sge.If( | ||
| this=sge.func("ABS", expr.expr) > sge.convert(1), | ||
| true=sge.func("IEEE_DIVIDE", sge.convert(0), sge.convert(0)), | ||
| ) | ||
| ], |
There was a problem hiding this comment.
We might want to add some comments on the necessity of this check.
There was a problem hiding this comment.
Using _NAN instead for better readability.
| ifs=[ | ||
| sge.If( | ||
| this=sge.func("ABS", expr.expr) > sge.convert(709.78), | ||
| true=sge.func("SIGN", expr.expr) | ||
| * sge.func("IEEE_DIVIDE", sge.convert(1), sge.convert(0)), | ||
| ) | ||
| ], | ||
| default=sge.func("SINH", expr.expr), |
There was a problem hiding this comment.
We might want to add some comments on the necessity of this check, specially for that seemingly magic number 709.78
There was a problem hiding this comment.
Updated to _FLOAT64_EXP_BOUND with some comments.
There was a problem hiding this comment.
Could you reformat the test functions in this file such that arrange/action/assert code blocks are demarcated with empty lines?
go/unit-testing-practices?polyglot=python#structure
Maybe ask Gemini for help?
There was a problem hiding this comment.
Done. Good points.
d1a4c07 to
5c0dcbf
Compare
This change contains three commits generated by Gemini CLI tool:
Fixes internal issue 430133370 🦕