Skip to content

Commit 474b8fb

Browse files
authored
fix(vertexai): tests (#1505)
1 parent 306f6ee commit 474b8fb

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

libs/vertexai/tests/integration_tests/test_vectorstores_v2.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def embeddings() -> VertexAIEmbeddings:
3131

3232

3333
@pytest.fixture(scope="module")
34+
@pytest.mark.extended
3435
def vector_store_v2(embeddings: VertexAIEmbeddings) -> VectorSearchVectorStore:
3536
"""Initializes a VectorSearchVectorStore for V2 batch updates."""
3637
project_id = os.environ["PROJECT_ID"]
@@ -85,6 +86,7 @@ def vector_store_v2(embeddings: VertexAIEmbeddings) -> VectorSearchVectorStore:
8586

8687

8788
@pytest.fixture
89+
@pytest.mark.extended
8890
def datastore_vector_store_v2(
8991
embeddings: VertexAIEmbeddings,
9092
) -> VectorSearchVectorStoreDatastore:
@@ -102,6 +104,7 @@ def datastore_vector_store_v2(
102104

103105

104106
@pytest.fixture(scope="module")
107+
@pytest.mark.extended
105108
def semantic_search_collection():
106109
"""Creates a collection with semantic search support and cleans up after tests."""
107110
project_id = os.environ["PROJECT_ID"]
@@ -159,6 +162,7 @@ def semantic_search_collection():
159162
print(f"Warning: Failed to delete collection {collection_id}: {e}")
160163

161164

165+
@pytest.mark.extended
162166
def test_vector_store_v2_add_texts_and_dense_search(
163167
vector_store_v2: VectorSearchVectorStore,
164168
):
@@ -180,6 +184,7 @@ def test_vector_store_v2_add_texts_and_dense_search(
180184
"configuration in collection"
181185
)
182186
)
187+
@pytest.mark.extended
183188
def test_vector_store_v2_hybrid_search(
184189
vector_store_v2: VectorSearchVectorStore, embeddings: VertexAIEmbeddings
185190
):
@@ -210,6 +215,7 @@ def test_vector_store_v2_hybrid_search(
210215
assert "sparse_score" in scores
211216

212217

218+
@pytest.mark.extended
213219
def test_vector_store_v2_advanced_filtering(
214220
vector_store_v2: VectorSearchVectorStore,
215221
):
@@ -235,6 +241,7 @@ def test_vector_store_v2_advanced_filtering(
235241
assert all(doc.metadata["price"] < 15000 for doc in documents)
236242

237243

244+
@pytest.mark.extended
238245
def test_vector_store_v2_return_full_datapoint(
239246
vector_store_v2: VectorSearchVectorStore, embeddings: VertexAIEmbeddings
240247
):
@@ -255,6 +262,7 @@ def test_vector_store_v2_return_full_datapoint(
255262
assert isinstance(score, float)
256263

257264

265+
@pytest.mark.extended
258266
def test_vector_store_v2_delete_by_ids(vector_store_v2: VectorSearchVectorStore):
259267
"""Tests deleting documents by IDs in V2."""
260268
texts = ["doc to delete", "doc to keep"]
@@ -273,6 +281,7 @@ def test_vector_store_v2_delete_by_ids(vector_store_v2: VectorSearchVectorStore)
273281
assert delete_id not in result_ids
274282

275283

284+
@pytest.mark.extended
276285
def test_vector_store_v2_delete_by_filter(vector_store_v2: VectorSearchVectorStore):
277286
"""Tests deleting documents by filter in V2 using the recommended workaround.
278287
@@ -325,6 +334,7 @@ def test_vector_store_v2_delete_by_filter(vector_store_v2: VectorSearchVectorSto
325334
)
326335

327336

337+
@pytest.mark.extended
328338
def test_vector_store_v2_semantic_search(
329339
semantic_search_collection, embeddings: VertexAIEmbeddings
330340
):
@@ -418,6 +428,7 @@ def test_vector_store_v2_semantic_search(
418428
assert len(animal_results) > 0, "Should find animal-related documents"
419429

420430

431+
@pytest.mark.extended
421432
def test_vector_store_v2_text_search(
422433
semantic_search_collection, embeddings: VertexAIEmbeddings
423434
):
@@ -503,6 +514,7 @@ def test_vector_store_v2_text_search(
503514
assert python_found, "Should find document containing 'Python'"
504515

505516

517+
@pytest.mark.extended
506518
def test_vector_store_v2_semantic_text_hybrid_search(
507519
semantic_search_collection, embeddings: VertexAIEmbeddings
508520
):

0 commit comments

Comments
 (0)