Gaurav598 opened a new pull request, #40625: URL: https://github.com/apache/beam/pull/40625
Fixes #19954. ### What changed `IOTypeHints.from_callable` previously passed string annotations to `convert_to_beam_type`, which maps them to `Any`. Resolve string annotations with `typing.get_type_hints` before conversion, including annotations on class constructors. Keep the existing `Any` fallback when a name cannot be resolved, and leave already evaluated annotations unchanged. ### Validation - Reproduced the original failure: an argument annotated as `int` became `Any`. - Added regression tests for the issue’s `typehints.List[str]` example, postponed annotations, methods, constructors, and unresolved names. - Ran 30 `IOTypeHintsTest` methods using the extracted source with dependency stubs on Python 3.12 and 3.14: all passed. - `py_compile` and trailing whitespace checks passed. The normal Beam test import could not run in this environment: the source archive lacks generated protobuf modules, and `google.protobuf` is not installed. The dependency-light harness excludes `test_origin_annotated`, which requires the full Beam package. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
