perf: Fold row count ops when known#1656
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.
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.
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.
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.
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> 🦕