[ https://issues.apache.org/jira/browse/BEAM-6877?focusedWorklogId=263348&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-263348 ]
ASF GitHub Bot logged work on BEAM-6877: ---------------------------------------- Author: ASF GitHub Bot Created on: 19/Jun/19 21:37 Start Date: 19/Jun/19 21:37 Worklog Time Spent: 10m Work Description: tvalentyn commented on pull request #8893: [BEAM-6877] trivial_inference: make remaining tests pass URL: https://github.com/apache/beam/pull/8893#discussion_r295534911 ########## File path: sdks/python/apache_beam/typehints/trivial_inference_test.py ########## @@ -235,6 +235,36 @@ def m(self, x): self.assertReturnType(typehints.Any, lambda: A.m(A(), 3.0), depth=0) self.assertReturnType(float, lambda: A.m(A(), 3.0), depth=1) + # pylint: disable=eval-used + # TODO(udim): Remove eval() call once Python 2 support is removed from Beam. + @unittest.skipIf(sys.version_info < (3,), 'Python 3 only') + def testBuildListUnpack(self): + # Lambda uses BUILD_LIST_UNPACK opcode in Python 3. + # Uses eval() to hide Python 3 syntax from Python 2. + eval('''self.assertReturnType(typehints.List[int], Review comment: Nice trick, FYI, @Juta who ran into this problem in one of the Py3-only tests. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 263348) Time Spent: 5h 40m (was: 5.5h) > TypeHints Py3 Error: Type inference tests fail on Python 3.6 due to bytecode > changes > ------------------------------------------------------------------------------------ > > Key: BEAM-6877 > URL: https://issues.apache.org/jira/browse/BEAM-6877 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core > Reporter: Robbe > Assignee: Udi Meiri > Priority: Major > Time Spent: 5h 40m > Remaining Estimate: 0h > > Type inference doesn't work on Python 3.6 due to [bytecode to wordcode > changes|https://docs.python.org/3/whatsnew/3.6.html#cpython-bytecode-changes]. > Type inference always returns Any on Python 3.6, so this is not critical. > Affected tests are: > *transforms.ptransform_test*: > - test_combine_properly_pipeline_type_checks_using_decorator > - test_mean_globally_pipeline_checking_satisfied > - test_mean_globally_runtime_checking_satisfied > - test_count_globally_pipeline_type_checking_satisfied > - test_count_globally_runtime_type_checking_satisfied > - test_pardo_type_inference > - test_pipeline_inference > - test_inferred_bad_kv_type > *typehints.trivial_inference_test*: > - all tests in TrivialInferenceTest > *io.gcp.pubsub_test.TestReadFromPubSubOverride*: > * test_expand_with_other_options > * test_expand_with_subscription > * test_expand_with_topic -- This message was sent by Atlassian JIRA (v7.6.3#76005)