-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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): Handle boolean comparisons in Iceberg predicate pushdown #18199
Conversation
CI failures in some Delta table tests which seem unrelated. |
@@ -163,3 +163,12 @@ def test_parse_lteq(self) -> None: | |||
|
|||
expr = _to_ast("(pa.compute.field('ts') <= '2023-08-08')") | |||
assert _convert_predicate(expr) == LessThanOrEqual("ts", "2023-08-08") | |||
|
|||
def test_compare_boolean(self) -> None: |
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.
Can you also add a test to validate you get the correct result?
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 would like to, yes. As I mentioned in the last paragraph of the PR description I’m not really sure how to go about that. Is there some other way that doesn’t involve recreating the iceberg table fixture with a new Boolean column?
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 also don't really know about iceberg. Ok, let's merge for now.
@dimfeld can you rebase and make CI green? |
Filtering columns on boolean literals failed trying to parse `pa.compute.scalar(True)`. This updates the Call predicate parser to handle the `scalar` type.
261193b
to
69fc732
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #18199 +/- ##
==========================================
- Coverage 79.89% 79.89% -0.01%
==========================================
Files 1495 1495
Lines 200214 200216 +2
Branches 2867 2868 +1
==========================================
- Hits 159966 159955 -11
- Misses 39702 39715 +13
Partials 546 546 ☔ View full report in Codecov by Sentry. |
Looks like we're all good now. Thanks! |
Wow, totally missed this one. Merging! 🙈 |
Filtering Iceberg table boolean columns on boolean literals fails trying to parse
pa.compute.scalar(True)
. This updates the Call predicate parser to handle thescalar
type.I originally posted about this in the Discord here which has a few more details: https://discord.com/channels/908022250106667068/1273409357685592159
The error was
which I traced back to the function that I've modified in this PR.
In addition to the parsing test I added here, it might also advisable to update the Iceberg table fixture as well and modify
test_scan_iceberg_filter_on_column
. But I'm not really sure what's the proper way to add a column to the fixture.