Skip to content
Open
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
8 changes: 6 additions & 2 deletions weaviate/collections/classes/config_vector_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class _VectorIndexConfigFlatCreate(_VectorIndexConfigCreate):

@staticmethod
def vector_index_type() -> VectorIndexType:
return VectorIndexType.FLAT
# Use a cached class-level constant to avoid repeatedly looking up the class attribute
if not hasattr(_VectorIndexConfigFlatCreate, "_VECTOR_INDEX_TYPE_FLAT"):
_VectorIndexConfigFlatCreate._VECTOR_INDEX_TYPE_FLAT = VectorIndexType.FLAT
return _VectorIndexConfigFlatCreate._VECTOR_INDEX_TYPE_FLAT


class _VectorIndexConfigHNSWUpdate(_VectorIndexConfigUpdate):
Expand Down Expand Up @@ -595,7 +598,8 @@ def dynamic(
Args:
See [the docs](https://weaviate.io/developers/weaviate/configuration/indexes#how-to-configure-hnsw) for a more detailed view!
""" # noqa: D417 (missing argument descriptions in the docstring)
return _VectorIndexConfigDynamicCreate(
cls = _VectorIndexConfigDynamicCreate
return cls(
distance=distance_metric,
threshold=threshold,
hnsw=hnsw,
Expand Down