From e633a1fb864f250e1f9f3edc29b3979d7db897ef Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Thu, 8 Oct 2026 21:07:07 +0100 Subject: [PATCH] Document vectorize_collection_name as having no effect on remaining multi2vec factories f8a6d4f1 applied the "Deprecated, has no effect." wording to the multi2vec_* factories in Configure.Vectorizer. The same argument is accepted and silently dropped by the eight multi2vec_* factories in Configure.NamedVectors, where the docstring still claimed it vectorized the collection name, and by Configure.Vectors.multi2vec_cohere, where it was accepted but undocumented. Apply the same wording there and add a test locking the documentation contract across all three surfaces. --- test/collection/test_config.py | 35 ++++++++++++++++++- .../classes/config_named_vectors.py | 16 ++++----- .../collections/classes/config_vectors.py | 1 + 3 files changed, 43 insertions(+), 9 deletions(-) diff --git a/test/collection/test_config.py b/test/collection/test_config.py index 360a0d138..9330136fe 100644 --- a/test/collection/test_config.py +++ b/test/collection/test_config.py @@ -1,4 +1,5 @@ -from typing import List, Union +import inspect +from typing import Callable, List, Union import pytest from pydantic import ValidationError @@ -2279,6 +2280,38 @@ def test_config_with_named_vectors( } +MULTI2VEC_FACTORIES_WITH_VECTORIZE_COLLECTION_NAME = [ + Configure.Vectorizer.multi2vec_cohere, + Configure.Vectorizer.multi2vec_clip, + Configure.Vectorizer.multi2vec_palm, + Configure.Vectorizer.multi2vec_google, + Configure.Vectorizer.multi2vec_bind, + Configure.Vectorizer.multi2vec_voyageai, + Configure.Vectorizer.multi2vec_nvidia, + Configure.Vectorizer.multi2vec_jinaai, + Configure.NamedVectors.multi2vec_cohere, + Configure.NamedVectors.multi2vec_clip, + Configure.NamedVectors.multi2vec_palm, + Configure.NamedVectors.multi2vec_google, + Configure.NamedVectors.multi2vec_bind, + Configure.NamedVectors.multi2vec_voyageai, + Configure.NamedVectors.multi2vec_nvidia, + Configure.NamedVectors.multi2vec_jinaai, + Configure.Vectors.multi2vec_cohere, +] + + +@pytest.mark.parametrize("factory", MULTI2VEC_FACTORIES_WITH_VECTORIZE_COLLECTION_NAME) +def test_multi2vec_vectorize_collection_name_deprecated(factory: Callable) -> None: + """`vectorize_collection_name` must be documented as having no effect in `multi2vec_*` factories. + + No `multi2vec-*` module reads `vectorizeClassName` server-side, so the argument is kept + for backwards compatibility only and must not be documented as functional. + """ + assert "vectorize_collection_name" in inspect.signature(factory).parameters + assert "vectorize_collection_name: Deprecated, has no effect." in (factory.__doc__ or "") + + TEST_CONFIG_WITH_VECTORS_PARAMETERS = [ ( [Configure.Vectors.text2vec_contextionary(name="test", source_properties=["prop"])], diff --git a/weaviate/collections/classes/config_named_vectors.py b/weaviate/collections/classes/config_named_vectors.py index 15f2e06e8..2ab4e5b0a 100644 --- a/weaviate/collections/classes/config_named_vectors.py +++ b/weaviate/collections/classes/config_named_vectors.py @@ -239,7 +239,7 @@ def multi2vec_cohere( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncate: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -534,7 +534,7 @@ def multi2vec_clip( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. image_fields: The image fields to use in vectorization. text_fields: The text fields to use in vectorization. inference_url: The inference url to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -581,7 +581,7 @@ def multi2vec_palm( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. location: Where the model runs. REQUIRED. project_id: The project ID to use, REQUIRED. image_fields: The image fields to use in vectorization. @@ -632,7 +632,7 @@ def multi2vec_google( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. location: Where the model runs. REQUIRED. project_id: The project ID to use, REQUIRED. audio_fields: The audio fields to use in vectorization. @@ -688,7 +688,7 @@ def multi2vec_bind( thermal_fields: The thermal fields to use in vectorization. video_fields: The video fields to use in vectorization. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. """ return _NamedVectorConfigCreate( name=name, @@ -725,7 +725,7 @@ def multi2vec_voyageai( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncation: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -770,7 +770,7 @@ def multi2vec_nvidia( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. truncation: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. @@ -1193,7 +1193,7 @@ def multi2vec_jinaai( Args: name: The name of the named vector. vector_index_config: The configuration for Weaviate's vector index. Use wvc.config.Configure.VectorIndex to create a vector index configuration. None by default - vectorize_collection_name: Whether to vectorize the collection name. Defaults to `True`. + vectorize_collection_name: Deprecated, has no effect. model: The model to use. Defaults to `None`, which uses the server-defined default. base_url: The base URL to use where API requests should go. Defaults to `None`, which uses the server-defined default. dimensions: The number of dimensions for the generated embeddings (only available for some models). Defaults to `None`, which uses the server-defined default. diff --git a/weaviate/collections/classes/config_vectors.py b/weaviate/collections/classes/config_vectors.py index edf1c3b89..c543d2d33 100644 --- a/weaviate/collections/classes/config_vectors.py +++ b/weaviate/collections/classes/config_vectors.py @@ -468,6 +468,7 @@ def multi2vec_cohere( text_fields: The text fields to use in vectorization. truncate: The truncation strategy to use. Defaults to `None`, which uses the server-defined default. vector_index_config: The configuration for Weaviate's vector index. Use `wvc.config.Configure.VectorIndex` to create a vector index configuration. None by default + vectorize_collection_name: Deprecated, has no effect. Raises: pydantic.ValidationError: If `model` is not a valid value from the `CohereMultimodalModel` type or if `truncate` is not a valid value from the `CohereTruncation` type.