Skip to content

Deprecate load/unload methods #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arango/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get(self, backup_id: Optional[str] = None) -> Result[Json]:
:type backup_id: str
:return: Backup details.
:rtype: dict
:raise arango.exceptions.BackupGetError: If delete fails.
:raise arango.exceptions.BackupGetError: If the operation fails.
"""
request = Request(
method="post",
Expand Down
16 changes: 16 additions & 0 deletions arango/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,10 +537,18 @@ def response_handler(resp: Response) -> Json:
def load(self) -> Result[bool]:
"""Load the collection into memory.

.. note::
The load function is deprecated from version 3.8.0 onwards and is a
no-op from version 3.9.0 onwards. It should no longer be used, as it
may be removed in a future version of ArangoDB.

:return: True if collection was loaded successfully.
:rtype: bool
:raise arango.exceptions.CollectionLoadError: If operation fails.
"""
m = "The load function is deprecated from version 3.8.0 onwards and is a no-op from version 3.9.0 onwards." # noqa: E501
warn(m, DeprecationWarning, stacklevel=2)

request = Request(method="put", endpoint=f"/_api/collection/{self.name}/load")

def response_handler(resp: Response) -> bool:
Expand All @@ -553,10 +561,18 @@ def response_handler(resp: Response) -> bool:
def unload(self) -> Result[bool]:
"""Unload the collection from memory.

.. note::
The unload function is deprecated from version 3.8.0 onwards and is a
no-op from version 3.9.0 onwards. It should no longer be used, as it
may be removed in a future version of ArangoDB.

:return: True if collection was unloaded successfully.
:rtype: bool
:raise arango.exceptions.CollectionUnloadError: If operation fails.
"""
m = "The unload function is deprecated from version 3.8.0 onwards and is a no-op from version 3.9.0 onwards." # noqa: E501
warn(m, DeprecationWarning, stacklevel=2)

request = Request(method="put", endpoint=f"/_api/collection/{self.name}/unload")

def response_handler(resp: Response) -> bool:
Expand Down
Loading