diff --git a/integration_v3/test_graphql.py b/integration_v3/test_graphql.py index aaacb45e7..2e77cfe09 100644 --- a/integration_v3/test_graphql.py +++ b/integration_v3/test_graphql.py @@ -94,7 +94,7 @@ def client(request): if opts.get("cluster"): port = 8087 for _, c in enumerate(schema["classes"]): - c["replicationConfig"] = {"factor": 2, "async_enabled": False} + c["replicationConfig"] = {"factor": 2, "asyncEnabled": False} client = weaviate.Client(f"http://localhost:{port}") client.schema.delete_all() diff --git a/integration_v3/test_schema.py b/integration_v3/test_schema.py index a52502ff0..58ba7bd58 100644 --- a/integration_v3/test_schema.py +++ b/integration_v3/test_schema.py @@ -30,22 +30,19 @@ def test_create_class_with_implicit_and_explicit_replication_config( }, ], } - if replicationFactor is None: - expected_factor = 1 - if asyncEnabled is None: - expected_async_enabled = False - else: - expected_factor = replicationFactor - single_class["replicationConfig"] = { - "factor": replicationFactor, - "async_enabled": asyncEnabled, - } + + expected_factor = 1 if replicationFactor == None else replicationFactor + expected_async_enabled = False if asyncEnabled == None else asyncEnabled + single_class["replicationConfig"] = { + "factor": replicationFactor, + "asyncEnabled": asyncEnabled, + } client.schema.create_class(single_class) created_class = client.schema.get("Barbecue") assert created_class["class"] == "Barbecue" assert created_class["replicationConfig"]["factor"] == expected_factor - assert created_class["replicationConfig"].get("async_enabled") == expected_async_enabled + assert created_class["replicationConfig"].get("asyncEnabled", False) == expected_async_enabled client.schema.delete_class("Barbecue") diff --git a/mock_tests/test_collection.py b/mock_tests/test_collection.py index 97dcda1f7..4eab6187c 100644 --- a/mock_tests/test_collection.py +++ b/mock_tests/test_collection.py @@ -242,7 +242,7 @@ def test_return_from_bind_module( "invertedIndexConfig": ii_config, "multiTenancyConfig": config.multi_tenancy()._to_dict(), "vectorizer": "multi2vec-bind", - "replicationConfig": {"factor": 2, "async_enabled": False}, + "replicationConfig": {"factor": 2, "asyncEnabled": False}, "moduleConfig": {"multi2vec-bind": {}}, } weaviate_auth_mock.expect_request("/v1/schema/TestBindCollection").respond_with_json( diff --git a/weaviate/collections/classes/config.py b/weaviate/collections/classes/config.py index 6d8693f39..169741d89 100644 --- a/weaviate/collections/classes/config.py +++ b/weaviate/collections/classes/config.py @@ -310,12 +310,12 @@ class _ShardingConfigCreate(_ConfigCreateModel): class _ReplicationConfigCreate(_ConfigCreateModel): factor: Optional[int] - async_enabled: Optional[bool] + asyncEnabled: Optional[bool] class _ReplicationConfigUpdate(_ConfigUpdateModel): factor: Optional[int] - async_enabled: Optional[bool] + asyncEnabled: Optional[bool] class _BM25ConfigCreate(_ConfigCreateModel): @@ -1789,7 +1789,7 @@ def replication( `async_enabled` Enabled async replication. """ - return _ReplicationConfigCreate(factor=factor, async_enabled=async_enabled) + return _ReplicationConfigCreate(factor=factor, asyncEnabled=async_enabled) @staticmethod def sharding( @@ -1997,7 +1997,7 @@ def replication( `async_enabled` Enable async replication. """ - return _ReplicationConfigUpdate(factor=factor, async_enabled=async_enabled) + return _ReplicationConfigUpdate(factor=factor, asyncEnabled=async_enabled) @staticmethod def multi_tenancy( diff --git a/weaviate/collections/classes/config_methods.py b/weaviate/collections/classes/config_methods.py index 2d3aac957..d58e1de3e 100644 --- a/weaviate/collections/classes/config_methods.py +++ b/weaviate/collections/classes/config_methods.py @@ -253,7 +253,7 @@ def _collection_config_from_json(schema: Dict[str, Any]) -> _CollectionConfig: references=_references_from_config(schema) if schema.get("properties") is not None else [], replication_config=_ReplicationConfig( factor=schema["replicationConfig"]["factor"], - async_enabled=schema["replicationConfig"].get("async_enabled"), + async_enabled=schema["replicationConfig"]["asyncEnabled"], ), reranker_config=__get_rerank_config(schema), sharding_config=( diff --git a/weaviate/schema/crud_schema.py b/weaviate/schema/crud_schema.py index 6da4b9236..b9accc1f5 100644 --- a/weaviate/schema/crud_schema.py +++ b/weaviate/schema/crud_schema.py @@ -517,7 +517,7 @@ def get(self, class_name: Optional[str] = None) -> dict: "vectorizer": "text2vec-contextionary", "replicationConfig": { "factor": 1, - "async_enabled": false + "asyncEnabled": false } } ] @@ -547,7 +547,7 @@ def get(self, class_name: Optional[str] = None) -> dict: "vectorizer": "text2vec-contextionary", "replicationConfig": { "factor": 1, - "async_enabled": false + "asyncEnabled": false } }