This is an automated email from the ASF dual-hosted git repository.

yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new d6d2433827d Fix python postcommit 30513 (#37849)
d6d2433827d is described below

commit d6d2433827d1aa23f8a4e2dbd173ec770fc50a6b
Author: Abdelrahman Ibrahim <[email protected]>
AuthorDate: Fri Mar 13 21:17:21 2026 +0200

    Fix python postcommit 30513 (#37849)
    
    * Fix Vertex AI image embedding test
    
    * Removed unused import
---
 sdks/python/apache_beam/ml/rag/embeddings/vertex_ai_test.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 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 43f52d9186f..5af8fe5661d 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
@@ -186,13 +185,9 @@ class VertexAIImageEmbeddingsTest(unittest.TestCase):
 
   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 +195,7 @@ class VertexAIImageEmbeddingsTest(unittest.TestCase):
             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_')

Reply via email to