-
Notifications
You must be signed in to change notification settings - Fork 47
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
chore: allow PRECEDING and FOLLOWING to appear on both side of BETWEEN when windowing #1507
Conversation
bigframes/core/window_spec.py
Outdated
start: Optional[WindowBoundary[int]] = None | ||
end: Optional[WindowBoundary[int]] = None |
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.
If we are going to create boundary classes, shouldn't we just go all the way and defined an "UNBOUNDED" subclass as well, instead of using null?
Alternatively, we can just stick to integers, and use postive and negative ints to mean following and proceeding respectively
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 call on sticking to integers. It makes subsequent processing logic much simpler!
bigframes/core/window_spec.py
Outdated
class WindowBoundary(Generic[T]): | ||
value: T |
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.
I'm a bit iffy on mixing value ranges and offsets in a single class, but I guess it works since the syntax is the same after (rows/range) between?
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.
Yes exactly. The syntax is defined just as you said.
…N when windowing (#1507) * chore: allow PRECEDING and FOLLOWING to appear on both side of BETWEEN when windowing * fix lint * Simplify the code by using the sign of the value for PRECEDING/FOLLOWING * fix lint * fix mypy * polish doc * remove float support for range rolling because Pandas does not support that
This paves the way for introducing
closed
parameter for rolling.