qdrant / qdrant-client

Python client for Qdrant vector search engine
https://qdrant.tech
Apache License 2.0
673 stars 106 forks source link

`init_from is deprecated` warnings on create collection calls #650

Open viktorku opened 2 weeks ago

viktorku commented 2 weeks ago

I'm creating collections using the documented example as found on the official website documentation. However I constantly get warnings that init_from is deprecated and I wasn't even able to find it in the repo here.

from qdrant_client import QdrantClient, models

client = QdrantClient(url="http://localhost:6333")

client.create_collection(
    collection_name="{collection_name}",
    vectors_config=models.VectorParams(size=100, distance=models.Distance.COSINE),
    init_from=models.InitFrom(collection="{from_collection_name}"),
)

I also see that init_from is supported on the API itself with no sign of deprecation soon.

I have no issues with the newly created collections, but the deprecation warning is a bit off-putting.

I'm using qdrant-client@1.9.1 and running the service in a container from the qdrant/qdrant:v1.9.5 image on x86_64 Linux

joein commented 1 week ago

Hi @viktorku

We've indeed deprecated InitFrom functionality, since it might not work correctly if there are ongoing write operations in the source collection Hence the warning

viktorku commented 1 week ago

Thanks for the clarification @joein. Does it make sense to have a warning that communicates that? I'm currently using it only for migrations during downtime, and no ongoing operations will obstruct the "copy" process.

If the plan is to ultimately remove the init_from functionality altogether, then I'd have to resort to calling the API directly. But it wouldn't make sense to remove it from the client if the service still supports it...