-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix(python): Support duplicate expression names when calling ufuncs #17641
Conversation
@@ -292,20 +292,34 @@ def __array_ufunc__( | |||
is_custom_ufunc = getattr(ufunc, "signature") is not None # noqa: B009 | |||
num_expr = sum(isinstance(inp, Expr) for inp in inputs) | |||
exprs = [ | |||
(inp, Expr, i) if isinstance(inp, Expr) else (inp, None, i) | |||
(inp, True, i) if isinstance(inp, Expr) else (inp, False, i) |
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 is just a small cleanup suggested by @deanm0000
Thanks to @deanm0000 for helping to figure out the solution. |
return root_expr.map_batches( | ||
function, is_elementwise=False | ||
).meta.undo_aliases() | ||
return root_expr.map_batches(function, is_elementwise=True).meta.undo_aliases() |
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 think my original reason for having undo_aliases
here was that I was trying to interact with the struct's inner columns by name but then abandoned that for square brackets and forgot to take out this undo_aliases so it serves no real purpose and it is good to take it out......I think
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17641 +/- ##
=======================================
Coverage ? 80.71%
=======================================
Files ? 1485
Lines ? 195493
Branches ? 2785
=======================================
Hits ? 157801
Misses ? 37179
Partials ? 513 ☔ View full report in Codecov by Sentry. |
Fixes #17472