This is an automated email from the ASF dual-hosted git repository. vterentev pushed a commit to branch fix-python-xlang in repository https://gitbox.apache.org/repos/asf/beam.git
commit aa39d9ee45a8aeb77f4d1a47e161d75c557808a7 Author: Vitaly Terentyev <[email protected]> AuthorDate: Mon Jun 2 18:07:01 2025 +0400 Add support for iterable type --- sdks/python/apache_beam/coders/row_coder.py | 2 ++ sdks/python/apache_beam/typehints/schemas.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/sdks/python/apache_beam/coders/row_coder.py b/sdks/python/apache_beam/coders/row_coder.py index dc473b1d6d7..520473a117d 100644 --- a/sdks/python/apache_beam/coders/row_coder.py +++ b/sdks/python/apache_beam/coders/row_coder.py @@ -161,6 +161,8 @@ def _nonnull_coder_from_type(field_type): return BytesCoder() elif type_info == "array_type": return IterableCoder(_coder_from_type(field_type.array_type.element_type)) + elif type_info == "iterable_type": + return IterableCoder(_coder_from_type(field_type.iterable_type.element_type)) elif type_info == "map_type": return MapCoder( _coder_from_type(field_type.map_type.key_type), diff --git a/sdks/python/apache_beam/typehints/schemas.py b/sdks/python/apache_beam/typehints/schemas.py index 23cad581345..de4cdb9fdf7 100644 --- a/sdks/python/apache_beam/typehints/schemas.py +++ b/sdks/python/apache_beam/typehints/schemas.py @@ -538,6 +538,10 @@ class SchemaTranslation(object): return LogicalType.from_runner_api( fieldtype_proto.logical_type).language_type() + elif type_info == "iterable_type": + return Sequence[self.typing_from_runner_api( + fieldtype_proto.iterable_type.element_type)] + else: raise ValueError(f"Unrecognized type_info: {type_info!r}")
