Skip to content

Commit

Permalink
fix: add sharding method to collection params conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
joein committed Sep 24, 2024
1 parent 8ad5574 commit bcb05b5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions qdrant_client/conversions/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ def convert_collection_params(cls, model: grpc.CollectionParams) -> rest.Collect
sparse_vectors=cls.convert_sparse_vector_config(model.sparse_vectors_config)
if model.HasField("sparse_vectors_config")
else None,
sharding_method=cls.convert_sharding_method(model.sharding_method)
if model.HasField("sharding_method")
else None,
)

@classmethod
Expand Down Expand Up @@ -2153,6 +2156,11 @@ def convert_collection_params(cls, model: rest.CollectionParams) -> grpc.Collect
if model.sparse_vectors is not None
else None
),
sharding_method=(
cls.convert_sharding_method(model.sharding_method)
if model.sharding_method is not None
else None
),
)

@classmethod
Expand Down
1 change: 1 addition & 0 deletions tests/conversions/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@
vectors_config=single_vector_config,
shard_number=10,
on_disk_payload=True,
sharding_method=grpc.ShardingMethod.Custom,
)

collection_params_2 = grpc.CollectionParams(
Expand Down

0 comments on commit bcb05b5

Please sign in to comment.