Skip to content

Conversation

@dirkkul
Copy link
Collaborator

@dirkkul dirkkul commented Dec 3, 2025

Turns out:

print(isinstance(True, int))

True

🤦

removes this warning:

filters.py:152: DeprecationWarning: Field weaviate.v1.Filters.value_int: Expected an int, got a boolean. This will be rejected in 7.34.0, please fix it before that (edited)

Copilot AI review requested due to automatic review settings December 3, 2025 08:15
Copy link

@orca-security-eu orca-security-eu bot left a 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
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Contributor

Copilot AI left a 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_list to 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.

@dirkkul dirkkul requested a review from Copilot December 3, 2025 08:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a 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-commenter
Copy link

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.59%. Comparing base (a788050) to head (2f7aa46).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
integration/test_collection_filter.py 50.00% 2 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dirkkul dirkkul merged commit c24dfe2 into main Dec 3, 2025
236 of 238 checks passed
@dirkkul dirkkul deleted the fix_bool_filters branch December 3, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants