Skip to content

Send empty vector index type on new Weavaite versions#2042

Merged
dirkkul merged 4 commits into
mainfrom
empty_default_vector_index
May 21, 2026
Merged

Send empty vector index type on new Weavaite versions#2042
dirkkul merged 4 commits into
mainfrom
empty_default_vector_index

Conversation

@dirkkul
Copy link
Copy Markdown
Collaborator

@dirkkul dirkkul commented May 20, 2026

No description provided.

Copilot AI review requested due to automatic review settings May 20, 2026 11:50
Copy link
Copy Markdown

@orca-security-eu orca-security-eu Bot left a comment

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

Copy link
Copy Markdown
Contributor

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.

Pull request overview

This PR updates collection schema creation so that for newer Weaviate servers (>= 1.37.4) the client can omit vectorIndexType in (named) vector configs, letting the server apply its own default vector index type, while preserving the existing HNSW default behavior for older servers.

Changes:

  • Add server-version-gated behavior in CollectionsExecutor.create() to decide whether to emit the client-side default vectorIndexType.
  • Thread a new emit_default_vector_index_type option through _CollectionConfigCreate._to_dict() and into named/default vector config _to_dict() implementations.
  • Conditionally omit vectorIndexType when no explicit vector index config is provided and the flag is disabled.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
weaviate/collections/collections/executor.py Computes the version-gated flag and passes it into config serialization during collection creation.
weaviate/collections/classes/config.py Adds flag plumbing to collection config serialization and conditionally emits top-level default vectorIndexType.
weaviate/collections/classes/config_vectors.py Allows omitting vectorIndexType for (default) vector configs when no explicit index config is set.
weaviate/collections/classes/config_named_vectors.py Allows omitting vectorIndexType for named vector configs when no explicit index config is set.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

return_dict["moduleConfig"][addition_key] = addition_val

def _to_dict(self) -> Dict[str, Any]:
def _to_dict(self, *, emit_default_vector_index_type: bool = True) -> Dict[str, Any]:
Comment thread weaviate/collections/classes/config_vectors.py
Comment thread weaviate/collections/classes/config_named_vectors.py
@dirkkul dirkkul requested a review from a team as a code owner May 21, 2026 10:12
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.76%. Comparing base (78fa5f7) to head (26b13fc).
⚠️ Report is 166 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2042      +/-   ##
==========================================
- Coverage   87.95%   86.76%   -1.20%     
==========================================
  Files         280      299      +19     
  Lines       21664    22931    +1267     
==========================================
+ Hits        19054    19895     +841     
- Misses       2610     3036     +426     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dirkkul dirkkul merged commit e75a914 into main May 21, 2026
124 of 125 checks passed
@dirkkul dirkkul deleted the empty_default_vector_index branch May 21, 2026 12:55
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.

4 participants