Skip to content
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

fix: [2.4]Remove params for property vars #2069

Merged
merged 1 commit into from
May 7, 2024
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
20 changes: 10 additions & 10 deletions pymilvus/orm/collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ def schema(self) -> CollectionSchema:
return self._schema

@property
def aliases(self, **kwargs) -> list:
def aliases(self) -> list:
"""List[str]: all the aliases of the collection."""
conn = self._get_connection()
resp = conn.describe_collection(self._name, **kwargs)
resp = conn.describe_collection(self._name)
return resp["aliases"]

@property
Expand All @@ -256,14 +256,14 @@ def is_empty(self) -> bool:
return self.num_entities == 0

@property
def num_shards(self, **kwargs) -> int:
def num_shards(self) -> int:
"""int: number of shards used by the collection."""
if self._num_shards is None:
self._num_shards = self.describe(timeout=kwargs.get("timeout")).get("num_shards")
self._num_shards = self.describe().get("num_shards")
return self._num_shards

@property
def num_entities(self, **kwargs) -> int:
def num_entities(self) -> int:
"""int: The number of entities in the collection, not real time.

Examples:
Expand All @@ -283,7 +283,7 @@ def num_entities(self, **kwargs) -> int:
2
"""
conn = self._get_connection()
stats = conn.get_collection_stats(collection_name=self._name, **kwargs)
stats = conn.get_collection_stats(collection_name=self._name)
result = {stat.key: stat.value for stat in stats}
result["row_count"] = int(result["row_count"])
return result["row_count"]
Expand Down Expand Up @@ -1111,7 +1111,7 @@ def query_iterator(
)

@property
def partitions(self, **kwargs) -> List[Partition]:
def partitions(self) -> List[Partition]:
"""List[Partition]: List of Partition object.

Raises:
Expand All @@ -1128,7 +1128,7 @@ def partitions(self, **kwargs) -> List[Partition]:
[{"name": "_default", "description": "", "num_entities": 0}]
"""
conn = self._get_connection()
partition_strs = conn.list_partitions(self._name, **kwargs)
partition_strs = conn.list_partitions(self._name)
partitions = []
for partition in partition_strs:
partitions.append(Partition(self, partition, construct_only=True))
Expand Down Expand Up @@ -1252,7 +1252,7 @@ def drop_partition(self, partition_name: str, timeout: Optional[float] = None, *
return conn.drop_partition(self._name, partition_name, timeout=timeout, **kwargs)

@property
def indexes(self, **kwargs) -> List[Index]:
def indexes(self) -> List[Index]:
"""List[Index]: list of indexes of this collection.

Examples:
Expand All @@ -1267,7 +1267,7 @@ def indexes(self, **kwargs) -> List[Index]:
"""
conn = self._get_connection()
indexes = []
tmp_index = conn.list_indexes(self._name, **kwargs)
tmp_index = conn.list_indexes(self._name)
for index in tmp_index:
if index is not None:
info_dict = {kv.key: kv.value for kv in index.params}
Expand Down
4 changes: 2 additions & 2 deletions pymilvus/orm/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def is_empty(self) -> bool:
return self.num_entities == 0

@property
def num_entities(self, **kwargs) -> int:
def num_entities(self) -> int:
"""int: number of entities in the partition

Examples:
Expand All @@ -132,7 +132,7 @@ def num_entities(self, **kwargs) -> int:
"""
conn = self._get_connection()
stats = conn.get_partition_stats(
collection_name=self._collection.name, partition_name=self.name, **kwargs
collection_name=self._collection.name, partition_name=self.name
)
result = {stat.key: stat.value for stat in stats}
result["row_count"] = int(result["row_count"])
Expand Down