mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-06 02:48:13 +00:00
fix(proxy): avoid reassigning a Final variable in the db where builder
basedpyright's reportGeneralTypeIssues budget counts the reassignment of the Final-annotated db_where_condition; express it as a single conditional expression instead.
This commit is contained in:
parent
6fc7f08b6e
commit
eb6af498f7
1 changed files with 5 additions and 4 deletions
|
|
@ -14498,10 +14498,11 @@ async def _fetch_db_models_for_search(
|
|||
match_conditions.append({"model_id": {"not": {"in": list(db_model_ids_in_router)}}})
|
||||
# Keep the single-condition shape flat: it is what existing callers (and
|
||||
# tests) assert, and Prisma treats both forms identically.
|
||||
if len(match_conditions) == 1:
|
||||
db_where_condition: Final[dict[str, Any]] = match_conditions[0]
|
||||
else:
|
||||
db_where_condition = {"AND": match_conditions}
|
||||
# Keep the single-condition shape flat: it is what existing callers (and
|
||||
# tests) assert, and Prisma treats both forms identically.
|
||||
db_where_condition: Final[dict[str, Any]] = (
|
||||
match_conditions[0] if len(match_conditions) == 1 else {"AND": match_conditions}
|
||||
)
|
||||
|
||||
# Unsorted searches only need enough DB rows to fill the current
|
||||
# page after counting router-side matches. Sorted searches need
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue