-
Notifications
You must be signed in to change notification settings - Fork 48
perf: Fold row count ops when known #1656
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
61cd804
to
a52e7d9
Compare
a52e7d9
to
83aeb4f
Compare
from bigframes.operations import aggregations | ||
|
||
|
||
def fold_row_counts(node: nodes.BigFrameNode) -> nodes.BigFrameNode: |
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.
A naming suggestion for this module: I think we can name the file as "row_counts"
The good thing is that if you want to add more re-write functions for row_counts in the future, they will all look like this row_counts.expand(..)
, row_counts.reverse(...)
, which keeps the code organized.
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.
fold_row_count
isn't the module though, core.compile.rewrite
is. For now this file just defines a single symbol, so figure best to be as precise as possible? Easy enough to change later if add more to this file.
bigframes/core/blocks.py
Outdated
.to_pydict() | ||
.values() | ||
) | ||
)[0] |
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.
Do we want to check and fail fast if the number of values is not equal to 1?
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.
Actually pulled this in to the execute result object itself, and add asserts
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> 🦕