From bb31f22de711071202b674aad0535851063ff35b Mon Sep 17 00:00:00 2001 From: Tommy Smith Date: Thu, 19 Feb 2026 13:10:16 +0000 Subject: [PATCH] Remove cache option from SQConfig, deprecate field in factory method --- weaviate/collections/classes/config.py | 1 - .../collections/classes/config_methods.py | 1 - .../classes/config_vector_index.py | 23 ++++++++++++++++--- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/weaviate/collections/classes/config.py b/weaviate/collections/classes/config.py index 6d8d5bdf1..e0432fa70 100644 --- a/weaviate/collections/classes/config.py +++ b/weaviate/collections/classes/config.py @@ -1768,7 +1768,6 @@ class _BQConfig(_ConfigBase): @dataclass class _SQConfig(_ConfigBase): - cache: Optional[bool] rescore_limit: int training_limit: int diff --git a/weaviate/collections/classes/config_methods.py b/weaviate/collections/classes/config_methods.py index f5297dc0d..15e82b9a0 100644 --- a/weaviate/collections/classes/config_methods.py +++ b/weaviate/collections/classes/config_methods.py @@ -133,7 +133,6 @@ def __get_quantizer_config( elif "sq" in config and config["sq"]["enabled"]: # values are not present for bq+hnsw quantizer = _SQConfig( - cache=config["sq"].get("cache"), rescore_limit=config["sq"].get("rescoreLimit"), training_limit=config["sq"].get("trainingLimit"), ) diff --git a/weaviate/collections/classes/config_vector_index.py b/weaviate/collections/classes/config_vector_index.py index ce70c9a0f..596cf0585 100644 --- a/weaviate/collections/classes/config_vector_index.py +++ b/weaviate/collections/classes/config_vector_index.py @@ -1,6 +1,6 @@ from abc import abstractmethod from enum import Enum -from typing import Any, Dict, Optional, overload +from typing import Any, Dict, Literal, Optional, overload from pydantic import Field from typing_extensions import deprecated @@ -265,7 +265,6 @@ def quantizer_name() -> str: class _SQConfigCreate(_QuantizerConfigCreate): - cache: Optional[bool] rescoreLimit: Optional[int] trainingLimit: Optional[int] @@ -423,6 +422,25 @@ def bq( rescoreLimit=rescore_limit, ) + @deprecated( + "The `cache` field is not supported by SQ and will be ignored if set. It will be removed in a future release." + ) + @overload + @staticmethod + def sq( + cache: bool, + rescore_limit: Optional[int] = None, + training_limit: Optional[int] = None, + ) -> _SQConfigCreate: ... + + @overload + @staticmethod + def sq( + cache: Literal[None] = None, + rescore_limit: Optional[int] = None, + training_limit: Optional[int] = None, + ) -> _SQConfigCreate: ... + @staticmethod def sq( cache: Optional[bool] = None, @@ -437,7 +455,6 @@ def sq( See [the docs](https://weaviate.io/developers/weaviate/concepts/vector-index#binary-quantization) for a more detailed view! """ # noqa: D417 (missing argument descriptions in the docstring) return _SQConfigCreate( - cache=cache, rescoreLimit=rescore_limit, trainingLimit=training_limit, )