From 0e829633582064d45de19532e37abe76f065158d Mon Sep 17 00:00:00 2001 From: Lijuan Tang Date: Sun, 31 May 2026 14:58:03 -0700 Subject: [PATCH] feat: deprecate `async_enabled` replication argument removed server-side The `asyncEnabled` field was removed from the Weaviate server schema in v1.38. The client still accepted `async_enabled` and forwarded it, so the server silently dropped it and the user's intent was lost without any indication (issue #2047). Following the existing precedent for `max_workers` / `alive_nodes_checking_frequency` (Dep029), the `async_enabled` argument in `Configure.replication` / `Reconfigure.replication` now emits a `DeprecationWarning` (Dep030) when passed, while remaining functional against older servers. Docstrings are updated to document the removal. Closes #2047 --- test/collection/test_config.py | 23 +++++++++++++++++++++++ weaviate/collections/classes/config.py | 20 +++++++++++++++++--- weaviate/warnings.py | 11 +++++++++++ 3 files changed, 51 insertions(+), 3 deletions(-) diff --git a/test/collection/test_config.py b/test/collection/test_config.py index 07e89aae2..b4d5945c4 100644 --- a/test/collection/test_config.py +++ b/test/collection/test_config.py @@ -3041,6 +3041,29 @@ def test_replication_config_update_merge_with_missing_async_config() -> None: assert result["factor"] == 3 +@pytest.mark.parametrize( + "config_factory", + [Configure.replication, Reconfigure.replication], +) +def test_replication_async_enabled_emits_deprecation_warning(config_factory: object) -> None: + """`async_enabled` was removed from the server schema in v1.38 and must warn when passed.""" + with pytest.warns(DeprecationWarning, match="Dep030"): + config_factory(async_enabled=True) # type: ignore[operator] + + +@pytest.mark.parametrize( + "config_factory", + [Configure.replication, Reconfigure.replication], +) +def test_replication_without_async_enabled_does_not_warn(config_factory: object) -> None: + """Omitting `async_enabled` must not emit the deprecation warning.""" + import warnings + + with warnings.catch_warnings(): + warnings.simplefilter("error", DeprecationWarning) + config_factory(factor=3) # type: ignore[operator] + + def test_nested_property_with_id_name_is_allowed() -> None: """A nested property named 'id' must not raise — only top-level 'id' is reserved.""" prop = Property( diff --git a/weaviate/collections/classes/config.py b/weaviate/collections/classes/config.py index 0f6d974c0..452f91490 100644 --- a/weaviate/collections/classes/config.py +++ b/weaviate/collections/classes/config.py @@ -2791,14 +2791,20 @@ def replication( ) -> _ReplicationConfigCreate: """Create a `ReplicationConfigCreate` object to be used when defining the replication configuration of Weaviate. - NOTE: `async_enabled` is only available with WeaviateDB `>=v1.26.0` + Note: + `async_enabled` was removed from the Weaviate server schema in v1.38. Passing it + has no effect against any server `>=v1.38` (the server silently drops it and runs + async replication by default for any class with a replication factor > 1) and emits + a ``DeprecationWarning``. The argument will be removed in a future release. Args: factor: The replication factor. async_enabled: Enabled async replication. deletion_strategy: How conflicts between different nodes about deleted objects are resolved. - async_config: The configuration for async replication. This is only relevant if `async_enabled` is `True`. + async_config: The configuration for async replication. """ + if async_enabled is not None: + _Warnings.async_enabled_field_removed_server_side() return _ReplicationConfigCreate( factor=factor, asyncEnabled=async_enabled, @@ -3071,12 +3077,20 @@ def replication( Use this method when defining the `replication_config` argument in `collection.update()`. + Note: + `async_enabled` was removed from the Weaviate server schema in v1.38. Passing it + has no effect against any server `>=v1.38` (the server silently drops it and runs + async replication by default for any class with a replication factor > 1) and emits + a ``DeprecationWarning``. The argument will be removed in a future release. + Args: factor: The replication factor. async_enabled: Enable async replication. deletion_strategy: How conflicts between different nodes about deleted objects are resolved. - async_config: The async replication configuration. This is only applicable if `async_enabled` is set to `True`. + async_config: The async replication configuration. """ + if async_enabled is not None: + _Warnings.async_enabled_field_removed_server_side() return _ReplicationConfigUpdate( factor=factor, asyncEnabled=async_enabled, diff --git a/weaviate/warnings.py b/weaviate/warnings.py index 1c0a1ae0b..2969d723e 100644 --- a/weaviate/warnings.py +++ b/weaviate/warnings.py @@ -261,6 +261,17 @@ def async_replication_field_removed_server_side(argument: str) -> None: stacklevel=1, ) + @staticmethod + def async_enabled_field_removed_server_side() -> None: + warnings.warn( + message="""Dep030: The `async_enabled` argument in `Configure.replication` / `Reconfigure.replication` is deprecated. + The `asyncEnabled` field was removed from the Weaviate server schema in v1.38 and is silently ignored by newer servers, + where async replication runs by default for any class with a replication factor > 1. + The argument has no effect against any server >= 1.38 and will be removed in a future release.""", + category=DeprecationWarning, + stacklevel=1, + ) + @staticmethod def datetime_insertion_with_no_specified_timezone(date: datetime) -> None: warnings.warn(