Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion weaviate/collections/classes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -1768,7 +1768,6 @@ class _BQConfig(_ConfigBase):

@dataclass
class _SQConfig(_ConfigBase):
cache: Optional[bool]
rescore_limit: int
training_limit: int

Expand Down
1 change: 0 additions & 1 deletion weaviate/collections/classes/config_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
)
Expand Down
23 changes: 20 additions & 3 deletions weaviate/collections/classes/config_vector_index.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -265,7 +265,6 @@ def quantizer_name() -> str:


class _SQConfigCreate(_QuantizerConfigCreate):
cache: Optional[bool]
rescoreLimit: Optional[int]
trainingLimit: Optional[int]

Expand Down Expand Up @@ -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,
Expand All @@ -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,
)
Expand Down
Loading