-
Notifications
You must be signed in to change notification settings - Fork 58
chore: implement eq, eq_null_match, ne compilers #2008
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
@@ -163,3 +175,16 @@ def _(op, left: TypedExpr, right: TypedExpr) -> sge.Expression: | |||
@BINARY_OP_REGISTRATION.register(ops.obj_make_ref_op) | |||
def _(op, left: TypedExpr, right: TypedExpr) -> sge.Expression: | |||
return sge.func("OBJ.MAKE_REF", left.expr, right.expr) | |||
|
|||
|
|||
def _coerce_bools( |
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.
This parameter design choice is a little weird. Suggestion:
let's create a "_coerce_bool_to_int" function that process one value at a time.
Then at callsite, we could
left_expr = _coerce_bool_to_int(left.expr)
right_expr = _coerce_bool_to_int(right.expr)
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 points. I added coerce_bool_to_int
and coerce_date_to_datetime
to the TypedExpr
class.
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.
Thanks! Could we make them top-level functions instead of class method?
I generally expect methods like TypedExpr.to_abc()
to still return a TypedExpr
value, which might make our code more verbose. Top-level functions feel like a better choice.
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.
Makes sense to me. Thanks!
621bbf0
to
9d96811
Compare
9d96811
to
31814df
Compare
31814df
to
0950b01
Compare
Fixes internal issue 430133370 🦕