Skip to content

fix: weaviate handles lowercase index names #1711

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

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test: improve testing
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
  • Loading branch information
jupyterjazz committed Jul 18, 2023
commit 00147c69702475140a81951beb3755ac96658d13
1 change: 1 addition & 0 deletions docarray/index/backends/weaviate.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ class DBConfig(BaseDocIndex.DBConfig):
def __post_init__(self):
# To prevent errors, it is important to capitalize the provided index name
# when working with Weaviate, as it stores index names in a capitalized format.
# Can't use .capitalize() because it modifies the whole string (See test).
self.index_name = (
self.index_name[0].upper() + self.index_name[1:]
if self.index_name
Expand Down
6 changes: 3 additions & 3 deletions tests/index/weaviate/test_column_config_weaviate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class StringDoc(BaseDoc):
index = WeaviateDocumentIndex[StringDoc]()
assert index.index_name == StringDoc.__name__

index = WeaviateDocumentIndex[StringDoc](index_name='Index_name')
assert index.index_name == 'Index_name'
index = WeaviateDocumentIndex[StringDoc](index_name='BaseDoc')
assert index.index_name == 'BaseDoc'

index = WeaviateDocumentIndex[StringDoc](index_name='Index_name')
index = WeaviateDocumentIndex[StringDoc](index_name='index_name')
assert index.index_name == 'Index_name'
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy