-
Notifications
You must be signed in to change notification settings - Fork 343
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify num_shards and mark shards_num as deprecated (#1412)
The user can still use shards_num to create collection. But **num_shards** are the recommanded way to create collection and the only way to get from a collection's property See also: milvus-io/milvus#23853 Signed-off-by: yangxuan <[email protected]>
- Loading branch information
1 parent
81511b6
commit 16e35e8
Showing
5 changed files
with
59 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ def __init__( | |
pk_field: str = None, | ||
vector_field: str = None, | ||
uri: str = "http://localhost:19530", | ||
shard_num: int = None, | ||
num_shards: int = None, | ||
partitions: List[str] = None, | ||
consistency_level: str = "Session", | ||
replica_number: int = 1, | ||
|
@@ -52,7 +52,7 @@ def __init__( | |
uri (str, optional): The connection address to use to connect to the | ||
instance. Defaults to "http://localhost:19530". Another example: | ||
"https://username:[email protected]:19538 | ||
shard_num (int, optional): The amount of shards to use for the collection. Unless | ||
num_shards (int, optional): The amount of shards to use for the collection. Unless | ||
dealing with huge scale, recommended to keep at default. Defaults to None and allows | ||
server to set. | ||
partitions (List[str], optional): Which paritions to create for the collection. | ||
|
@@ -81,7 +81,7 @@ def __init__( | |
|
||
self.uri = uri | ||
self.collection_name = collection_name | ||
self.shard_num = shard_num | ||
self.num_shards = num_shards | ||
self.partitions = partitions | ||
self.consistency_level = consistency_level | ||
self.replica_number = replica_number | ||
|
@@ -725,7 +725,7 @@ def _create_collection(self, data: dict) -> None: | |
name=self.collection_name, | ||
schema=schema, | ||
consistency_level=self.consistency_level, | ||
shards_num=self.shard_num, | ||
num_shards=self.num_shards, | ||
num_partitions=self.num_partitions, | ||
using=self.alias, | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters