How to pytest for collection config with QdrantLocal?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 304
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 37
Description
Hi, we want to test in CI/CD, that a collection does have expected configuration values.
from qdrant_client import QdrantClient
from qdrant_client.models import VectorParams, Distance,
client = QdrantClient(':memory:') # same with client = QdrantClient(path="qdrant_data")
client.create_collection(
collection_name="my_collection",
on_disk_payload=False,
vectors_config=VectorParams(size=100, distance=Distance.COSINE)
)
collection = client.get_collection("my_collection")
assert collection.config.params.on_disk_payload == False # Fails
assert collection.config.params.on_disk_payload == None # Succeeds
I want the first assertion to succeed. Is this somehow possible? for QdrantClient(path="qdrant_data") there is a meta.json written to the qdrant_data folder. Couldn't there end up also the passed configuration?
Our use case:
We create a collection that is loaded into memory. When we create a new collection, we want to keep the old collection and label it as backup collection. The backup collection should be moved to disk.
Now we want to test with pytest that the config changes and e. g. on_disk_payload is set to True after it is labeled as backup collection.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the QdrantClient(':memory:') and QdrantClient(path="qdrant_data") reproduction in the issue, then inspect the collection creation and get_collection implementations and related tests. Check how on_disk_payload is stored and returned, and add or update a pytest case so the returned configuration reflects the value passed to create_collection; the existing assertions define the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- databases, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100