Skip to content

Raise FilterError for unknown filter operators - #11798

Closed
GioiaZheng wants to merge 1 commit into
deepset-ai:mainfrom
GioiaZheng:filter-error-for-unknown-operators
Closed

Raise FilterError for unknown filter operators#11798
GioiaZheng wants to merge 1 commit into
deepset-ai:mainfrom
GioiaZheng:filter-error-for-unknown-operators

Conversation

@GioiaZheng

Copy link
Copy Markdown

Summary

  • Validate comparison and logical filter operators before looking them up.
  • Raise FilterError with the unsupported operator and the valid operator set instead of a bare KeyError.
  • Add regression coverage for unknown comparison (gt) and logical (XOR) operators.

Fixes #11794

Validation

  • HAYSTACK_TELEMETRY_ENABLED=false pytest test/utils/test_filters.py - 94 passed
  • ruff check haystack/utils/filters.py test/utils/test_filters.py
  • ruff format --check haystack/utils/filters.py test/utils/test_filters.py
  • git diff --check

@GioiaZheng
GioiaZheng requested a review from a team as a code owner June 28, 2026 20:52
@GioiaZheng
GioiaZheng requested review from davidsbatista and removed request for a team June 28, 2026 20:52
@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

@GioiaZheng is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Jun 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@davidsbatista

Copy link
Copy Markdown
Contributor

There was already a PR open for this issue #11795

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metadata filters raise a cryptic KeyError on unknown/typo'd operators instead of FilterError

3 participants