From 38f31043f7c66a406462706898fb1eed9100cd44 Mon Sep 17 00:00:00 2001 From: apanich Date: Fri, 10 Apr 2026 14:55:36 -0400 Subject: [PATCH 1/4] Update core.py --- sdks/python/apache_beam/transforms/core.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/transforms/core.py b/sdks/python/apache_beam/transforms/core.py index b5c3178210d9..4e026369c526 100644 --- a/sdks/python/apache_beam/transforms/core.py +++ b/sdks/python/apache_beam/transforms/core.py @@ -2456,10 +2456,9 @@ def expand(self, pcoll): tagged_type_hints = dict(self._fn.get_type_hints().tagged_output_types()) # Dead letter format: Tuple[element, Tuple[exception_type, repr, traceback]] - dead_letter_type = typehints.Tuple[pcoll.element_type, - typehints.Tuple[type, - str, - typehints.List[str]]] + dead_letter_type = typehints.Tuple[ + pcoll.element_type, + typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]] tagged_type_hints[self._dead_letter_tag] = dead_letter_type pardo = pardo.with_output_types(main_output_type, **tagged_type_hints) From 07e9d066dba55f365cb7ce8aeb28b4cda9c1ccdc Mon Sep 17 00:00:00 2001 From: apanich Date: Fri, 10 Apr 2026 15:20:33 -0400 Subject: [PATCH 2/4] Update core_test.py --- sdks/python/apache_beam/transforms/core_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/transforms/core_test.py b/sdks/python/apache_beam/transforms/core_test.py index d80a03bdf53b..ccc6c69d6d8a 100644 --- a/sdks/python/apache_beam/transforms/core_test.py +++ b/sdks/python/apache_beam/transforms/core_test.py @@ -22,6 +22,7 @@ import os import tempfile import unittest +from typing import Any from typing import Iterable from typing import Literal from typing import TypeVar @@ -561,7 +562,7 @@ def test_with_exception_handling_then_with_outputs(self): self.assertEqual(results.fives.element_type, str) self.assertEqual( results.bad.element_type, - typehints.Tuple[int, typehints.Tuple[type, str, typehints.List[str]]]) + typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) def test_with_outputs_then_with_exception_handling(self): """Direction 2: .with_outputs().with_exception_handling()""" @@ -584,7 +585,7 @@ def test_with_outputs_then_with_exception_handling(self): self.assertEqual(results.fives.element_type, str) self.assertEqual( results.bad.element_type, - typehints.Tuple[int, typehints.Tuple[type, str, typehints.List[str]]]) + typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) def test_with_outputs_then_with_exception_handling_custom_dead_letter_tag( self): @@ -605,7 +606,7 @@ def test_with_outputs_then_with_exception_handling_custom_dead_letter_tag( self.assertEqual(results.threes.element_type, int) self.assertEqual( results.errors.element_type, - typehints.Tuple[int, typehints.Tuple[type, str, typehints.List[str]]]) + typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) def test_with_exception_handling_then_with_outputs_custom_dead_letter_tag( self): @@ -626,7 +627,7 @@ def test_with_exception_handling_then_with_outputs_custom_dead_letter_tag( self.assertEqual(results.threes.element_type, int) self.assertEqual( results.errors.element_type, - typehints.Tuple[int, typehints.Tuple[type, str, typehints.List[str]]]) + typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) def test_exception_handling_no_with_outputs_backward_compat(self): """Without with_outputs(), behavior is unchanged.""" From e13dd45c794b46518ec882fcb68b55f004cb6fd9 Mon Sep 17 00:00:00 2001 From: apanich Date: Fri, 10 Apr 2026 15:56:07 -0400 Subject: [PATCH 3/4] Update core_test.py --- sdks/python/apache_beam/transforms/core_test.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sdks/python/apache_beam/transforms/core_test.py b/sdks/python/apache_beam/transforms/core_test.py index ccc6c69d6d8a..f42ab1d2549c 100644 --- a/sdks/python/apache_beam/transforms/core_test.py +++ b/sdks/python/apache_beam/transforms/core_test.py @@ -562,7 +562,7 @@ def test_with_exception_handling_then_with_outputs(self): self.assertEqual(results.fives.element_type, str) self.assertEqual( results.bad.element_type, - typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) + typehints.Tuple[int, typehints.Tuple[type[Any], str, typehints.Sequence[str]]]) def test_with_outputs_then_with_exception_handling(self): """Direction 2: .with_outputs().with_exception_handling()""" @@ -585,7 +585,7 @@ def test_with_outputs_then_with_exception_handling(self): self.assertEqual(results.fives.element_type, str) self.assertEqual( results.bad.element_type, - typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) + typehints.Tuple[int, typehints.Tuple[type[Any], str, typehints.Sequence[str]]]) def test_with_outputs_then_with_exception_handling_custom_dead_letter_tag( self): @@ -606,7 +606,7 @@ def test_with_outputs_then_with_exception_handling_custom_dead_letter_tag( self.assertEqual(results.threes.element_type, int) self.assertEqual( results.errors.element_type, - typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) + typehints.Tuple[int, typehints.Tuple[type[Any], str, typehints.Sequence[str]]]) def test_with_exception_handling_then_with_outputs_custom_dead_letter_tag( self): @@ -627,7 +627,7 @@ def test_with_exception_handling_then_with_outputs_custom_dead_letter_tag( self.assertEqual(results.threes.element_type, int) self.assertEqual( results.errors.element_type, - typehints.Tuple[int, typehints.Tuple[type[typing.Any], str, typehints.Sequence[str]]]) + typehints.Tuple[int, typehints.Tuple[type[Any], str, typehints.Sequence[str]]]) def test_exception_handling_no_with_outputs_backward_compat(self): """Without with_outputs(), behavior is unchanged.""" From a01c0e9645401734aabc5e52514e93c9d11e6ace Mon Sep 17 00:00:00 2001 From: Alex Panich Date: Sat, 11 Apr 2026 08:01:49 -0400 Subject: [PATCH 4/4] Re-trigger checks