Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-10217

Suboptimal type inference on Python 3.6

Details

    • Bug
    • Status: Resolved
    • P2
    • Resolution: Fixed
    • None
    • Not applicable
    • sdk-py-core
    • None

    Description

      Following trivial_inference_test fails for me with AssertionError: :: List[Tuple[Person, int]] != List[Any] on Python 3.6.8; Passed on 3.5.2, 3.5.6 and 3.7.3.

        def testMethodReturnsTuple(self):
          class Person(object):
            def __init__(self, name):
              self.name = name
      
          def parse_record(name_and_age):
            name, age = name_and_age.split(',')
            return Person(name), int(age)
      
          self.assertReturnType(typehints.List[typehints.Tuple[Person, int]],
                                lambda record: [parse_record(record)], [str])
      

      See: https://github.com/apache/beam/pull/11954.

      Attachments

        Activity

          People

            udim Udi Meiri
            tvalentyn Valentyn Tymofieiev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h
                2h