-
Notifications
You must be signed in to change notification settings - Fork 104
Fix boolean filters #1902
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 boolean filters #1902
Conversation
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.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
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.
Pull request overview
This PR fixes a bug in boolean filter handling where Python's type hierarchy (bool is a subclass of int) caused booleans to be incorrectly treated as integers, triggering deprecation warnings in Weaviate v1.
Key Changes:
- Added early-return logic to handle boolean values before integer checks in filter conversion
- Updated
__filter_to_int_listto explicitly exclude boolean values from integer array detection - Enhanced test coverage to verify no warnings are raised when processing boolean filters
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| weaviate/collections/filters.py | Implements boolean-specific handling in __value_filter and excludes booleans from integer type checks in __filter_to_int_list |
| integration/test_collection_filter.py | Adds warning detection to verify booleans are correctly handled and changes collection configuration parameters |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1902 +/- ##
==========================================
+ Coverage 86.55% 86.59% +0.03%
==========================================
Files 273 273
Lines 19769 19777 +8
==========================================
+ Hits 17112 17126 +14
+ Misses 2657 2651 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Turns out:
print(isinstance(True, int))
🤦
removes this warning: