litellm/tests/unit/llms/bedrock/vector_stores
mateo-berri a7c0d215c7 fix(bedrock): check OpenAI vector store filter values per operator and keep nested groups within the AWS limit
AWS in and notIn take only a non-empty list of strings, so an in or nin list holding a number now goes out as orAll of equals or andAll of notEquals, and a one-item list as a single equals or notEquals

Each OpenAI filter now refuses keys it does not define and checks its value by operator: eq and ne take a scalar, gt, gte, lt and lte take a number, in and nin take a non-empty list. An empty filters object is invalid too. Each of these answers 400 before any AWS call, or is dropped under drop_params, where before it reached AWS and failed there or, for a stray key, was silently ignored

AWS rejects a RetrievalFilter nested more than 2 levels deep, so a group whose member is the same kind of group, written by the caller or made from a numeric in or nin, now takes that member's items. A mix of and and or nested deeper than AWS allows still fails at AWS

_aws_group_members joins the recursion detector's ignore list, since it walks only a validated filter that pydantic-core stops at 255 levels

Backport to lts/1.108.x.
Cherry-picked from b15ac0fe6b and 2232dba0db (litellm_bedrock_vector_store_openai_filters), whose main PR follows as the forward-port.
2026-11-11 20:31:28 -08:00
..
__init__.py test(unit): make every tests/unit directory a package so pytest collection is unique 2026-09-20 11:50:59 +00:00
test_bedrock_vector_store_transformation.py fix(bedrock): check OpenAI vector store filter values per operator and keep nested groups within the AWS limit 2026-11-11 20:31:28 -08:00