From 01a76b3013a6bf31c48c9217b7f4827a25cf9a71 Mon Sep 17 00:00:00 2001 From: choccccy Date: Fri, 14 Jun 2024 15:31:06 -0600 Subject: [PATCH] even more matching --- pylib/embedding/pgvector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylib/embedding/pgvector.py b/pylib/embedding/pgvector.py index 86563d0..2b0fea2 100644 --- a/pylib/embedding/pgvector.py +++ b/pylib/embedding/pgvector.py @@ -199,7 +199,7 @@ def match_exact(key, val): ''' Filter specifier to only return rows where the given top-level key exists in metadata, and matches the given value ''' - assert key.isalnum() + assert key.strip('-_').isalnum() if isinstance(val, str): cast = '' elif isinstance(val, bool): @@ -220,7 +220,7 @@ def match_oneof(key, options: tuple[str]): ''' options = tuple(options) assert options - assert key.isalnum() + assert key.strip('-_').isalnum() option1 = options[0] if isinstance(option1, str): cast = ''