-
Notifications
You must be signed in to change notification settings - Fork 590
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
refactor(sql): automatically add simple ops implementations #8349
Conversation
|
Looks like I'm on the road to breaking ... everything! |
394450d
to
bee593f
Compare
| ops.IntervalMultiply: sge.Mul, | ||
| ops.IntervalSubtract: sge.Sub, | ||
| } | ||
|
|
||
| def __init__(self) -> None: | ||
| self.agg = AggGen(aggfunc=self._aggregate) | ||
| self.f = FuncGen() | ||
| self.v = VarGen() | ||
|
|
||
| def __init_subclass__(cls, **kwargs): |
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.
So the only reason we need to construct and attach methods here is because of has_operation looks for the method? Couldn't we move this logic into a handler which would compile all value nodes if those are not explicitly overwritten?
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.
like
def visit(...):
method_name = ...
if self.hasattr(method_name):
call that specific method
else:
self.visit_Value() # which would handle simple opsthen has_operation would condier the cls.SIMPLE_OPS mapping
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.
Maybe, but I don't want to spend time making this improvement perfect here. If you have an idea for a further improvement, that can be done in a follow up.
bee593f
to
c513e62
Compare
c513e62
to
b4e5b72
Compare
|
Doesn't seem like my CI fixes for label running helped 😞 |
…ject#8349) Follow up to ibis-project#8338 to clean up the SIMPLE_OPS boilerplate.
Follow up to #8338 to clean up the SIMPLE_OPS boilerplate.