Skip to content

Commit

Permalink
Removed return statement
Browse files Browse the repository at this point in the history
  • Loading branch information
bsuryadevara committed Nov 8, 2023
1 parent a4838ce commit c3f7916
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 36 deletions.
11 changes: 2 additions & 9 deletions morpheus/service/vdb/milvus_vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,25 +1064,18 @@ def describe(self, name: str, **kwargs: dict[str, typing.Any]) -> dict:

return resource.describe(**kwargs)

def release_resource(self, name: str) -> bool:
def release_resource(self, name: str) -> None:
"""
Release a loaded collection from memory.
Release a loaded collection from the memory.
Parameters
----------
name : str
Name of the collection to release.
Returns
-------
bool
Returns True if release process is successful, otherwise raises MilvusException.
"""

self._client.release_collection(collection_name=name)

return True

def close(self) -> None:
"""
Close the connection to the Milvus vector database.
Expand Down
9 changes: 2 additions & 7 deletions morpheus/service/vdb/vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,19 +431,14 @@ def describe(self, name: str, **kwargs: dict[str, typing.Any]) -> dict:
pass

@abstractmethod
def release_resource(self, name: str) -> bool:
def release_resource(self, name: str) -> None:
"""
Release a loaded resource from memory.
Release a loaded resource from the memory.
Parameters
----------
name : str
Name of the resource to release.
Returns
-------
bool
Returns True if resource successfully released.
"""
pass

Expand Down
20 changes: 0 additions & 20 deletions tests/test_milvus_vector_db_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,26 +364,6 @@ def test_delete(milvus_service: MilvusVectorDBService, idx_part_collection_confi
milvus_service.drop(collection_name)


def test_release_collection(milvus_service: MilvusVectorDBService,
idx_part_collection_config: dict,
milvus_data: list[dict]):
collection_name = "test_release_collection"

# Make sure to drop any existing collection from previous runs.
milvus_service.drop(collection_name)

# Create a collection.
milvus_service.create(collection_name, **idx_part_collection_config)

# Insert data into the collection.
milvus_service.insert(collection_name, milvus_data)

# Release resource from the memory.
is_released = milvus_service.release_resource(name=collection_name)

assert is_released


def test_get_collection_lock():
"""
This test doesn't require milvus server to be running.
Expand Down

0 comments on commit c3f7916

Please sign in to comment.