From c794247110841418437c2b033e9783f849a88ed0 Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Wed, 3 Dec 2025 08:45:02 +0100 Subject: [PATCH 1/2] Reorder overloads to remove deprecation warning in pycharm --- weaviate/collections/collections/async_.pyi | 20 ++++++++++---------- weaviate/collections/collections/sync.pyi | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/weaviate/collections/collections/async_.pyi b/weaviate/collections/collections/async_.pyi index d8d7e1521..b5327b179 100644 --- a/weaviate/collections/collections/async_.pyi +++ b/weaviate/collections/collections/async_.pyi @@ -28,9 +28,6 @@ from weaviate.connect.v4 import ConnectionAsync class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): @overload - @deprecated( - 'Using the "vector_index_config" argument is deprecated. Instead, define the vector index for each specific vectorizer supplied to the "vectorizers_config" argument.' - ) async def create( self, name: str, @@ -44,7 +41,7 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): replication_config: Optional[_ReplicationConfigCreate] = None, reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, - vector_index_config: _VectorIndexConfigCreate, + vector_index_config: Optional[_VectorIndexConfigCreate] = None, vectorizer_config: Optional[ Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] ] = None, @@ -55,7 +52,7 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): ) -> CollectionAsync[Properties, References]: ... @overload @deprecated( - 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vectorizers_config" argument.' + 'Using the "vector_index_config" argument is deprecated. Instead, define the vector index for each specific vectorizer supplied to the "vectorizers_config" argument.' ) async def create( self, @@ -70,14 +67,19 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): replication_config: Optional[_ReplicationConfigCreate] = None, reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, - vector_index_config: Optional[_VectorIndexConfigCreate] = None, - vectorizer_config: Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]], + vector_index_config: _VectorIndexConfigCreate, + vectorizer_config: Optional[ + Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] + ] = None, vector_config: Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]] = None, data_model_properties: Optional[Type[Properties]] = None, data_model_references: Optional[Type[References]] = None, skip_argument_validation: bool = False, ) -> CollectionAsync[Properties, References]: ... @overload + @deprecated( + 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vectorizers_config" argument.' + ) async def create( self, name: str, @@ -92,9 +94,7 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, vector_index_config: Optional[_VectorIndexConfigCreate] = None, - vectorizer_config: Optional[ - Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] - ] = None, + vectorizer_config: Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]], vector_config: Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]] = None, data_model_properties: Optional[Type[Properties]] = None, data_model_references: Optional[Type[References]] = None, diff --git a/weaviate/collections/collections/sync.pyi b/weaviate/collections/collections/sync.pyi index a6d92e313..1ab4c3cc1 100644 --- a/weaviate/collections/collections/sync.pyi +++ b/weaviate/collections/collections/sync.pyi @@ -28,9 +28,6 @@ from weaviate.connect.v4 import ConnectionSync class _Collections(_CollectionsBase[ConnectionSync]): @overload - @deprecated( - 'Using the "vector_index_config" argument is deprecated. Instead, define the vector index for each specific vectorizer supplied to the "vector_config" argument.' - ) def create( self, name: str, @@ -44,7 +41,7 @@ class _Collections(_CollectionsBase[ConnectionSync]): replication_config: Optional[_ReplicationConfigCreate] = None, reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, - vector_index_config: _VectorIndexConfigCreate, + vector_index_config: Optional[_VectorIndexConfigCreate] = None, vectorizer_config: Optional[ Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] ] = None, @@ -55,7 +52,7 @@ class _Collections(_CollectionsBase[ConnectionSync]): ) -> Collection[Properties, References]: ... @overload @deprecated( - 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vector_config" argument.' + 'Using the "vector_index_config" argument is deprecated. Instead, define the vector index for each specific vectorizer supplied to the "vector_config" argument.' ) def create( self, @@ -70,14 +67,19 @@ class _Collections(_CollectionsBase[ConnectionSync]): replication_config: Optional[_ReplicationConfigCreate] = None, reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, - vector_index_config: Optional[_VectorIndexConfigCreate] = None, - vectorizer_config: Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]], + vector_index_config: _VectorIndexConfigCreate, + vectorizer_config: Optional[ + Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] + ] = None, vector_config: Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]] = None, data_model_properties: Optional[Type[Properties]] = None, data_model_references: Optional[Type[References]] = None, skip_argument_validation: bool = False, ) -> Collection[Properties, References]: ... @overload + @deprecated( + 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vector_config" argument.' + ) def create( self, name: str, @@ -92,9 +94,7 @@ class _Collections(_CollectionsBase[ConnectionSync]): reranker_config: Optional[_RerankerProvider] = None, sharding_config: Optional[_ShardingConfigCreate] = None, vector_index_config: Optional[_VectorIndexConfigCreate] = None, - vectorizer_config: Optional[ - Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]] - ] = None, + vectorizer_config: Union[_VectorizerConfigCreate, List[_NamedVectorConfigCreate]], vector_config: Optional[Union[_VectorConfigCreate, List[_VectorConfigCreate]]] = None, data_model_properties: Optional[Type[Properties]] = None, data_model_references: Optional[Type[References]] = None, From bbd4a80ce2bed11de2c86fdf86eae4091184c904 Mon Sep 17 00:00:00 2001 From: Dirk Kulawiak Date: Wed, 3 Dec 2025 08:55:47 +0100 Subject: [PATCH 2/2] Fix deprecation warning message --- weaviate/collections/collections/async_.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weaviate/collections/collections/async_.pyi b/weaviate/collections/collections/async_.pyi index b5327b179..af66b4469 100644 --- a/weaviate/collections/collections/async_.pyi +++ b/weaviate/collections/collections/async_.pyi @@ -52,7 +52,7 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): ) -> CollectionAsync[Properties, References]: ... @overload @deprecated( - 'Using the "vector_index_config" argument is deprecated. Instead, define the vector index for each specific vectorizer supplied to the "vectorizers_config" argument.' + 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vector_config" argument.' ) async def create( self, @@ -78,7 +78,7 @@ class _CollectionsAsync(_CollectionsBase[ConnectionAsync]): ) -> CollectionAsync[Properties, References]: ... @overload @deprecated( - 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vectorizers_config" argument.' + 'Using the "vectorizer_config" argument is deprecated. Instead, use the "vector_config" argument.' ) async def create( self,