From 57ec6de8700e891aaf3de1ffeaa2b1185befde78 Mon Sep 17 00:00:00 2001 From: Radek Stankiewicz Date: Mon, 6 Oct 2025 15:34:10 +0200 Subject: [PATCH 1/2] enrichment returns row fields in different order. simple split string makes comparison of rows flaky. --- .../examples/snippets/transforms/elementwise/enrichment_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py index 904b90710225..69040a22296a 100644 --- a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py +++ b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py @@ -134,7 +134,7 @@ def test_enrichment_with_vertex_ai(self, mock_stdout): expected = sorted(validate_enrichment_with_vertex_ai()) for i in range(len(expected)): - self.assertEqual(set(output[i].split(',')), set(expected[i].split(','))) + self.assertEqual(set(output[i][4:-1].split(',')), set(expected[i][4:-1].split(','))) def test_enrichment_with_vertex_ai_legacy(self, mock_stdout): enrichment_with_vertex_ai_legacy() From 6faa37ff556b0a22d656cd68ae4b86e853f76943 Mon Sep 17 00:00:00 2001 From: Radek Stankiewicz Date: Mon, 6 Oct 2025 15:50:37 +0200 Subject: [PATCH 2/2] format --- .../snippets/transforms/elementwise/enrichment_test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py index 69040a22296a..176eaa61e7a8 100644 --- a/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py +++ b/sdks/python/apache_beam/examples/snippets/transforms/elementwise/enrichment_test.py @@ -134,7 +134,8 @@ def test_enrichment_with_vertex_ai(self, mock_stdout): expected = sorted(validate_enrichment_with_vertex_ai()) for i in range(len(expected)): - self.assertEqual(set(output[i][4:-1].split(',')), set(expected[i][4:-1].split(','))) + self.assertEqual( + set(output[i][4:-1].split(',')), set(expected[i][4:-1].split(','))) def test_enrichment_with_vertex_ai_legacy(self, mock_stdout): enrichment_with_vertex_ai_legacy()