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

client.recreate_collection TypeError #312

Closed
superMDguy opened this issue Sep 23, 2023 · 4 comments
Closed

client.recreate_collection TypeError #312

superMDguy opened this issue Sep 23, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@superMDguy
Copy link

superMDguy commented Sep 23, 2023

I tried creating a recreating a collection using the GRPC api.

client.recreate_collection(
    collection_name="new",
    vectors_config=models.VectorParams(
                size=EMBEDDING_DIMS, distance=models.Distance.COSINE
            ),
    init_from=models.InitFrom(
        collection="old"
    )
)

Got this error:

File [...python3.11/site-packages/qdrant_client/qdrant_remote.py:1747, in QdrantRemote.create_collection(self, collection_name, vectors_config, shard_number, replication_factor, write_consistency_factor, on_disk_payload, hnsw_config, optimizers_config, wal_config, quantization_config, init_from, timeout, **kwargs)
   1741     if isinstance(
   1742         quantization_config,
   1743         get_args(models.QuantizationConfig),
   1744     ):
   1745         quantization_config = RestToGrpc.convert_quantization_config(quantization_config)
-> 1747     create_collection = grpc.CreateCollection(
   1748         collection_name=collection_name,
   1749         hnsw_config=hnsw_config,
   1750         wal_config=wal_config,
   1751         optimizers_config=optimizers_config,
   1752         shard_number=shard_number,
   1753         on_disk_payload=on_disk_payload,
   1754         timeout=timeout,
   1755         vectors_config=vectors_config,
   1756         replication_factor=replication_factor,
   1757         write_consistency_factor=write_consistency_factor,
   1758         init_from_collection=init_from,
   1759         quantization_config=quantization_config,
   1760     )
   1761     return self.grpc_collections.Create(create_collection).result
   1763 if isinstance(hnsw_config, grpc.HnswConfigDiff):

TypeError: bad argument type for built-in operation

Python client version: 1.5.4
Server version: 1.5.1

A similar PUT request worked:

PUT /collections/new
{
    "vectors": {
      "size": 1536,
      "distance": "Cosine"
    },
    "init_from": {
       "collection": "old"
    }
}
@joein
Copy link
Member

joein commented Sep 23, 2023

Hey @superMDguy

Thank you for pointing it out
It is indeed a error on our side, we will fix it soon
Http qdrant client should work fine at the moment

@superMDguy
Copy link
Author

Thanks, temporarily switched to http and it's working

@joein joein added the bug Something isn't working label Sep 28, 2023
@joein joein self-assigned this Sep 28, 2023
@joein
Copy link
Member

joein commented Sep 28, 2023

#317

@joein
Copy link
Member

joein commented Sep 29, 2023

should be available with the next release

@joein joein closed this as completed Oct 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants