You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 20:06:22 UTC

[GitHub] [beam] damccorm opened a new issue, #20899: Type inference works incorrectly with tuple slices

damccorm opened a new issue, #20899:
URL: https://github.com/apache/beam/issues/20899

   Returning a slice of the tuple doesn't alter the type inference output. For example:
     
   `@beam.typehints.with_output_types(Tuple[int, str])`
   `class Foo(beam.DoFn):`
   `  def process(self, a):`
   `    yield a, str(a)`
   `pcoll = beam.Pipeline() `| beam.Create([1]) | beam.ParDo(Foo()) | beam.Map(lambda x: x[1:])
   `print(pcoll.element_type)`
     
    This prints Tuple[int, str], while the real type is str. At worst, this should return Any.
   
   Imported from Jira [BEAM-12413](https://issues.apache.org/jira/browse/BEAM-12413). Original Jira may contain additional context.
   Reported by: dmkozh.


-- 
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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org