Skip to content

fix(local): preserve datatype for created dense vectors#1206

Open
pragnyanramtha wants to merge 2 commits into
qdrant:devfrom
pragnyanramtha:pragnyan/fix-local-create-vector-name-datatype-master
Open

fix(local): preserve datatype for created dense vectors#1206
pragnyanramtha wants to merge 2 commits into
qdrant:devfrom
pragnyanramtha:pragnyan/fix-local-create-vector-name-datatype-master

Conversation

@pragnyanramtha
Copy link
Copy Markdown

@pragnyanramtha pragnyanramtha commented May 16, 2026

Summary

  • preserve DenseVectorConfig.datatype in collection metadata when local mode creates a dense named vector
  • keep local vector storage behavior unchanged; local mode still stores dense vectors as float32 and does not apply storage datatypes
  • add an in-memory regression test for get_collection() metadata after create_vector_name()

Validation

  • .venv/bin/python -m pytest tests/test_in_memory.py::test_create_vector_name_preserves_dense_datatype_in_collection_metadata -q
  • .venv/bin/python -m pytest tests/test_in_memory.py -q
  • .venv/bin/python -m pytest tests/test_local_persistence.py -q
  • .venv/bin/ruff check qdrant_client/local/local_collection.py tests/test_in_memory.py
  • git diff --check

@netlify
Copy link
Copy Markdown

netlify Bot commented May 16, 2026

Deploy Preview for poetic-froyo-8baba7 ready!

Name Link
🔨 Latest commit b198010
🔍 Latest deploy log https://app.netlify.com/projects/poetic-froyo-8baba7/deploys/6a0bb8bc826f7c000803c7b2
😎 Deploy Preview https://deploy-preview-1206--poetic-froyo-8baba7.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pragnyanramtha pragnyanramtha marked this pull request as ready for review May 16, 2026 16:30
Copilot AI review requested due to automatic review settings May 16, 2026 16:30
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eff0a547-4168-4aa9-a2cc-d5d73970f872

📥 Commits

Reviewing files that changed from the base of the PR and between 916ddbd and b198010.

📒 Files selected for processing (2)
  • qdrant_client/local/local_collection.py
  • tests/test_in_memory.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_in_memory.py

📝 Walkthrough

Walkthrough

This PR adds datatype parameter preservation to dense vector configuration in local collections. The implementation change in LocalCollection.create_dense_vector_name now explicitly passes datatype=config.datatype to the constructed VectorParams. A new test validates that the configured dense vector datatype (FLOAT16) is correctly preserved when creating a named dense vector in an in-memory collection. A minor formatting adjustment updates test assertion message wrapping.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: preserving the datatype field in dense vector metadata when creating named vectors in local mode.
Description check ✅ Passed The description is directly related to the changeset, explaining the fix, the scope of changes, validation steps performed, and clarifying that storage behavior remains unchanged.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@joein
Copy link
Copy Markdown
Member

joein commented May 16, 2026

Hey @pragnyanramtha

Thanks for your interest in qdrant-client!

We don't utilise datatype in local mode, so preserving it might cause some confusion.
Also, all the changes should point dev branch, not master.

A branch can point master only if it is a hotfix requiring a merge before dev

@pragnyanramtha pragnyanramtha force-pushed the pragnyan/fix-local-create-vector-name-datatype-master branch from 916ddbd to 178dda7 Compare May 16, 2026 20:40
@pragnyanramtha pragnyanramtha changed the base branch from master to dev May 16, 2026 20:40
@pragnyanramtha
Copy link
Copy Markdown
Author

Thanks for the review, @joein.

I retargeted this PR to dev and rebased the branch on the current dev tip.

I also tightened the PR description and test name to clarify the scope: this does not make local mode use datatype for storage or indexing. Local dense vectors are still stored as float32; the change only preserves the requested datatype in collection metadata returned by get_collection(), matching existing local behavior for create_collection() metadata and remote create_vector_name() responses.

Validation run on the rebased branch:

  • .venv/bin/python -m pytest tests/test_in_memory.py::test_create_vector_name_preserves_dense_datatype_in_collection_metadata -q
  • .venv/bin/python -m pytest tests/test_in_memory.py -q
  • .venv/bin/python -m pytest tests/test_local_persistence.py -q
  • .venv/bin/ruff check qdrant_client/local/local_collection.py tests/test_in_memory.py
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants