Skip to content

Commit cb92e42

Browse files
speedstorm1copybara-github
authored andcommitted
chore: update tests to be compatible with Python 3.14, set 3.14 testing workflow as required
PiperOrigin-RevId: 825273830
1 parent 6737a70 commit cb92e42

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed

testing/constraints-3.14.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ ipython==8.22.2 # Pinned to unbreak TypeAliasType import error
1313
google-adk==0.0.2
1414
google-genai>=1.10.0
1515
google-vizier==0.1.21
16-
pyarrow>=18.0.0
16+
pyarrow>=22.0.0

tests/unit/aiplatform/test_prediction.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3287,7 +3287,10 @@ def test_health(self, model_server_env_mock, importlib_import_module_mock_twice)
32873287

32883288
assert response.status_code == 200
32893289

3290-
def test_predict(self, model_server_env_mock, importlib_import_module_mock_twice):
3290+
@pytest.mark.asyncio
3291+
async def test_predict(
3292+
self, model_server_env_mock, importlib_import_module_mock_twice
3293+
):
32913294
model_server = CprModelServer()
32923295
client = TestClient(model_server.app)
32933296

tests/unit/vertex_rag/test_rag_data.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,10 @@ def create_transformation_config(
419419
def rag_corpus_eq(returned_corpus, expected_corpus):
420420
assert returned_corpus.name == expected_corpus.name
421421
assert returned_corpus.display_name == expected_corpus.display_name
422-
assert returned_corpus.backend_config.__eq__(expected_corpus.backend_config)
423-
assert returned_corpus.vertex_ai_search_config.__eq__(
424-
expected_corpus.vertex_ai_search_config
422+
assert returned_corpus.backend_config == expected_corpus.backend_config
423+
assert (
424+
returned_corpus.vertex_ai_search_config
425+
== expected_corpus.vertex_ai_search_config
425426
)
426427

427428

@@ -464,8 +465,8 @@ def import_files_request_eq(returned_request, expected_request):
464465

465466
def rag_engine_config_eq(returned_config, expected_config):
466467
assert returned_config.name == expected_config.name
467-
assert returned_config.rag_managed_db_config.__eq__(
468-
expected_config.rag_managed_db_config
468+
assert (
469+
returned_config.rag_managed_db_config == expected_config.rag_managed_db_config
469470
)
470471

471472

tests/unit/vertex_rag/test_rag_data_preview.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,13 @@ def create_transformation_config(
674674
def rag_corpus_eq(returned_corpus, expected_corpus):
675675
assert returned_corpus.name == expected_corpus.name
676676
assert returned_corpus.display_name == expected_corpus.display_name
677-
assert returned_corpus.vector_db.__eq__(expected_corpus.vector_db)
678-
assert returned_corpus.backend_config.__eq__(expected_corpus.backend_config)
679-
assert returned_corpus.vertex_ai_search_config.__eq__(
680-
expected_corpus.vertex_ai_search_config
677+
assert returned_corpus.vector_db == expected_corpus.vector_db
678+
assert returned_corpus.backend_config == expected_corpus.backend_config
679+
assert (
680+
returned_corpus.vertex_ai_search_config
681+
== expected_corpus.vertex_ai_search_config
681682
)
682-
assert returned_corpus.corpus_type_config.__eq__(expected_corpus.corpus_type_config)
683+
assert returned_corpus.corpus_type_config == expected_corpus.corpus_type_config
683684

684685

685686
def rag_file_eq(returned_file, expected_file):
@@ -729,8 +730,8 @@ def import_files_request_eq(returned_request, expected_request):
729730

730731
def rag_engine_config_eq(returned_config, expected_config):
731732
assert returned_config.name == expected_config.name
732-
assert returned_config.rag_managed_db_config.__eq__(
733-
expected_config.rag_managed_db_config
733+
assert (
734+
returned_config.rag_managed_db_config == expected_config.rag_managed_db_config
734735
)
735736

736737

vertexai/preview/rag/utils/_gapic_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,11 +353,12 @@ def convert_gapic_to_rag_corpus(gapic_rag_corpus: GapicRagCorpus) -> RagCorpus:
353353
vertex_ai_search_config=convert_gapic_to_vertex_ai_search_config(
354354
gapic_rag_corpus.vertex_ai_search_config
355355
),
356-
backend_config=convert_gapic_to_backend_config(
357-
gapic_rag_corpus.vector_db_config
358-
),
359356
encryption_spec=gapic_rag_corpus.encryption_spec,
360357
)
358+
if gapic_rag_corpus.vector_db_config:
359+
rag_corpus.backend_config = convert_gapic_to_backend_config(
360+
gapic_rag_corpus.vector_db_config
361+
)
361362
return rag_corpus
362363

363364

vertexai/rag/utils/_gapic_utils.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,12 @@ def convert_gapic_to_rag_corpus(gapic_rag_corpus: GapicRagCorpus) -> RagCorpus:
217217
vertex_ai_search_config=convert_gapic_to_vertex_ai_search_config(
218218
gapic_rag_corpus.vertex_ai_search_config
219219
),
220-
backend_config=convert_gapic_to_backend_config(
221-
gapic_rag_corpus.vector_db_config
222-
),
223220
encryption_spec=gapic_rag_corpus.encryption_spec,
224221
)
222+
if gapic_rag_corpus.vector_db_config:
223+
rag_corpus.backend_config = convert_gapic_to_backend_config(
224+
gapic_rag_corpus.vector_db_config
225+
)
225226
return rag_corpus
226227

227228

0 commit comments

Comments
 (0)