-
Notifications
You must be signed in to change notification settings - Fork 3k
Python: Refactor expression hierarchy #5389
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -120,13 +120,13 @@ def _(obj: ExpressionB, visitor: BooleanExpressionVisitor) -> List: | |
| [ | ||
| ( | ||
| base.And(ExpressionA(), ExpressionB()), | ||
| "And(ExpressionA(), ExpressionB())", | ||
| "And(left=ExpressionA(), right=ExpressionB())", | ||
| ), | ||
| ( | ||
| base.Or(ExpressionA(), ExpressionB()), | ||
| "Or(ExpressionA(), ExpressionB())", | ||
| "Or(left=ExpressionA(), right=ExpressionB())", | ||
| ), | ||
| (base.Not(ExpressionA()), "Not(ExpressionA())"), | ||
| (base.Not(ExpressionA()), "Not(child=ExpressionA())"), | ||
| ], | ||
| ) | ||
| def test_reprs(op, rep): | ||
|
|
@@ -208,9 +208,9 @@ def test_notnan_bind_nonfloat(): | |
| @pytest.mark.parametrize( | ||
| "op, string", | ||
| [ | ||
| (base.And(ExpressionA(), ExpressionB()), "And(testexpra, testexprb)"), | ||
| (base.Or(ExpressionA(), ExpressionB()), "Or(testexpra, testexprb)"), | ||
| (base.Not(ExpressionA()), "Not(testexpra)"), | ||
| (base.And(ExpressionA(), ExpressionB()), "And(left=ExpressionA(), right=ExpressionB())"), | ||
| (base.Or(ExpressionA(), ExpressionB()), "Or(left=ExpressionA(), right=ExpressionB())"), | ||
| (base.Not(ExpressionA()), "Not(child=ExpressionA())"), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: since updating this file, maybe worth try simply LINE 220 to 245 as Sam suggested in https://github.com/apache/iceberg/pull/5362/files#r932825540 def test_ref_binding_case_sensitive(request):
schema = request.getfixturevalue("table_schema_simple")can be replaced by python def test_ref_binding_case_sensitive(table_schema_simple):
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't make that change because I think it is easier to understand what's happening when we use less magic. Using |
||
| ], | ||
| ) | ||
| def test_strs(op, string): | ||
|
|
||
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.
Nit / non-blocking: An
Unbound[BoundTerm[T]]is somewhat of a confusing type signature (particularly coming more from the Java side).However
UnboundTermitself is clear as day so that's not particularly a concern.