diff --git a/arangoasync/replication.py b/arangoasync/replication.py index e495e89..6a81d44 100644 --- a/arangoasync/replication.py +++ b/arangoasync/replication.py @@ -2,6 +2,7 @@ from typing import Optional +from warnings import warn from arangoasync.exceptions import ( ReplicationApplierConfigError, @@ -195,7 +196,9 @@ def response_handler(resp: Response) -> Json: return await self._executor.execute(request, response_handler) async def applier_config(self) -> Result[Json]: - """Return the configuration of the replication applier. + """**Removed** in ArangoDB v3.12.10. + + Return the configuration of the replication applier. Returns: dict: Configuration of the replication applier. @@ -206,6 +209,9 @@ async def applier_config(self) -> Result[Json]: References: - `get-the-replication-applier-configuration `__ """ # noqa: E501 + m = "/_api/replication/applier-config was removed in ArangoDB v3.12.10." + warn(m, DeprecationWarning, stacklevel=2) + request = Request( method=Method.GET, endpoint="/_api/replication/applier-config", @@ -220,7 +226,9 @@ def response_handler(resp: Response) -> Json: return await self._executor.execute(request, response_handler) async def applier_state(self) -> Result[Json]: - """Return the state of the replication applier. + """**Removed** in ArangoDB v3.12.10. + + Return the state of the replication applier. Returns: dict: State of the replication applier. @@ -231,6 +239,9 @@ async def applier_state(self) -> Result[Json]: References: - `get-the-replication-applier-state `__ """ # noqa: E501 + m = "/_api/replication/applier-state was removed in ArangoDB v3.12.10." + warn(m, DeprecationWarning, stacklevel=2) + request = Request( method=Method.GET, endpoint="/_api/replication/applier-state", diff --git a/tests/test_database.py b/tests/test_database.py index 11ac608..c9cc14b 100644 --- a/tests/test_database.py +++ b/tests/test_database.py @@ -20,8 +20,6 @@ DatabaseSupportInfoError, JWTSecretListError, JWTSecretReloadError, - ReplicationApplierConfigError, - ReplicationApplierStateError, ReplicationClusterInventoryError, ReplicationDumpError, ReplicationInventoryError, @@ -215,14 +213,6 @@ async def test_replication(db, bad_db, cluster): await bad_db.replication.logger_state() result = await db.replication.logger_state() assert isinstance(result, dict) - with pytest.raises(ReplicationApplierConfigError): - await bad_db.replication.applier_config() - result = await db.replication.applier_config() - assert isinstance(result, dict) - with pytest.raises(ReplicationApplierStateError): - await bad_db.replication.applier_state() - result = await db.replication.applier_state() - assert isinstance(result, dict) with pytest.raises(ReplicationServerIDError): await bad_db.replication.server_id() result = await db.replication.server_id()