Skip to content

Commit 70747cd

Browse files
Gaudy BlancoGaudy Blanco
authored andcommitted
fix test
1 parent 183a960 commit 70747cd

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

tests/integration/vector_stores/test_factory.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ def __init__(self, **kwargs):
131131
def connect(self, **kwargs):
132132
pass
133133

134-
def load_documents(self, documents, overwrite=True):
134+
def create_index(self, **kwargs):
135+
pass
136+
137+
def load_documents(self, documents):
135138
pass
136139

137140
def similarity_search_by_vector(self, query_embedding, k=10, **kwargs):

tests/integration/vector_stores/test_lancedb.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ def test_vector_store_operations(self, sample_documents):
6464
)
6565
)
6666
vector_store.connect(db_uri=temp_dir)
67+
vector_store.create_index()
6768
vector_store.load_documents(sample_documents[:2])
6869

6970
if vector_store.index_name:
@@ -83,6 +84,7 @@ def test_vector_store_operations(self, sample_documents):
8384
assert isinstance(results[0].score, float)
8485

8586
# Test append mode
87+
vector_store.create_index()
8688
vector_store.load_documents([sample_documents[2]])
8789
result = vector_store.search_by_id("3")
8890
assert result.id == "3"
@@ -121,6 +123,7 @@ def test_empty_collection(self):
121123
id="tmp",
122124
vector=[0.1, 0.2, 0.3, 0.4, 0.5],
123125
)
126+
vector_store.create_index()
124127
vector_store.load_documents([sample_doc])
125128
vector_store.db_connection.open_table(
126129
vector_store.index_name if vector_store.index_name else ""
@@ -137,6 +140,7 @@ def test_empty_collection(self):
137140
id="1",
138141
vector=[0.1, 0.2, 0.3, 0.4, 0.5],
139142
)
143+
vector_store.create_index()
140144
vector_store.load_documents([doc])
141145

142146
result = vector_store.search_by_id("1")
@@ -157,7 +161,7 @@ def test_filter_search(self, sample_documents_categories):
157161
)
158162

159163
vector_store.connect(db_uri=temp_dir)
160-
164+
vector_store.create_index()
161165
vector_store.load_documents(sample_documents_categories)
162166

163167
# Filter to include only documents about animals
@@ -186,6 +190,7 @@ def test_vector_store_customization(self, sample_documents):
186190
),
187191
)
188192
vector_store.connect(db_uri=temp_dir)
193+
vector_store.create_index()
189194
vector_store.load_documents(sample_documents[:2])
190195

191196
if vector_store.index_name:
@@ -205,6 +210,7 @@ def test_vector_store_customization(self, sample_documents):
205210
assert isinstance(results[0].score, float)
206211

207212
# Test append mode
213+
vector_store.create_index()
208214
vector_store.load_documents([sample_documents[2]])
209215
result = vector_store.search_by_id("3")
210216
assert result.id == "3"

0 commit comments

Comments
 (0)