From 6e2845450af0e3224900293cfbcc9c24bd797df0 Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 13 Mar 2026 13:59:02 +0200 Subject: [PATCH 1/2] Fix Vertex AI image embedding test --- .../apache_beam/ml/rag/embeddings/vertex_ai_test.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py b/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py index 43f52d9186fc..86b3f38bfcf7 100644 --- a/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py +++ b/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py @@ -186,13 +186,9 @@ def test_image_embedding_pipeline(self): def test_image_embedding_pipeline_from_path(self): png_bytes = _create_png_bytes() - img_path = os.path.join(self.artifact_location, 'test_img.png') - with open(img_path, 'wb') as f: - f.write(png_bytes) - test_items = [ EmbeddableItem.from_image( - img_path, id="img1", metadata={"source": "test"}), + png_bytes, id="img1", metadata={"source": "test"}), ] expected = [ @@ -200,7 +196,7 @@ def test_image_embedding_pipeline_from_path(self): id="img1", embedding=Embedding(dense_embedding=[0.0] * 1408), metadata={"source": "test"}, - content=Content(image=img_path)), + content=Content(image=png_bytes)), ] artifact_location = tempfile.mkdtemp(prefix='vertex_ai_img_path_') From b639951898ce72901b7b2e7a8adc465e0d0269fb Mon Sep 17 00:00:00 2001 From: aIbrahiim Date: Fri, 13 Mar 2026 17:36:11 +0200 Subject: [PATCH 2/2] Removed unused import --- sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py b/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py index 86b3f38bfcf7..5af8fe5661d0 100644 --- a/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py +++ b/sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py @@ -16,7 +16,6 @@ """Tests for apache_beam.ml.rag.embeddings.vertex_ai.""" -import os import shutil import struct import tempfile