Skip to content

fix: give clear error message for invalid metadata filter keys - #6530

Merged
mattf merged 1 commit into
ogx-ai:mainfrom
mattf:feat-helpful-filter-key-validation
Sep 12, 2026
Merged

mattf merged 1 commit into
ogx-ai:mainfrom
mattf:feat-helpful-filter-key-validation

Conversation

@mattf

@mattf mattf commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Keys containing characters outside [a-zA-Z0-9_-] were passed through to providers and caused obscure SQL errors (e.g. OperationalError: near ";": syntax error) surfaced as 500 responses. Add a Pydantic field_validator on ComparisonFilter.key (matching the existing pgvector pattern) so users get a helpful validation error at the API boundary explaining which characters are allowed.

Keys containing characters outside [a-zA-Z0-9_-] were passed through
to providers and caused obscure SQL errors (e.g. OperationalError:
near ";": syntax error) surfaced as 500 responses. Add a Pydantic
field_validator on ComparisonFilter.key (matching the existing pgvector
pattern) so users get a helpful validation error at the API boundary
explaining which characters are allowed.

Signed-off-by: Matthew Farrellee <matt@cs.wisc.edu>
@mattf
mattf marked this pull request as ready for review September 10, 2026 13:14
@mattf
mattf merged commit 317836d into ogx-ai:main Sep 12, 2026
58 checks passed
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.

1 participant