-
Notifications
You must be signed in to change notification settings - Fork 42
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: Define RowJoinNode and defer rewrite #1183
base: main
Are you sure you want to change the base?
Conversation
bigframes/core/blocks.py
Outdated
@@ -2335,8 +2335,8 @@ def join( | |||
# Handle null index, which only supports row join | |||
# This is the canonical way of aligning on null index, so always allow (ignore block_identity_join) | |||
if self.index.nlevels == other.index.nlevels == 0: | |||
result = try_legacy_row_join(self, other, how=how) or try_new_row_join( | |||
self, other | |||
result = try_new_row_join(self, other) or try_legacy_row_join( |
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.
We should probably rename "try_new_row_join" now or in the future. The reason is that I guess "try_legacy_row_join" will be eventually removed, and it would be very confusing if we have only a "new" version.
We can just call it "try_row_join".
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.
renamed to try_row_join
new_exprs = ( | ||
*root.child.assignments, | ||
*( | ||
(expr.bind_refs(mapping, allow_partial_bindings=True), id) |
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 tuple comprehension is very long. Shall we use another local variable "root_assignments" to hold the value?
And
"new_exprs = tuple(root.child.assignments) + root_assignments"
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.
extracted out to variable as suggested
# should be impossible, as l_path[-1] == r_path[-1] | ||
raise ValueError() | ||
min_height = min(root.height for root in roots) | ||
to_descend = set(root for root in roots if root.height > min_height) |
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.
It took me a while to realize that to_descend
is a set of root notes.
Let's name it "descend_roots" ?
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.
renamed to roots_to_descend
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> 🦕