[jira] [Commented] (BEAM-9755) infer_return_type does not infer as expected in Python 3.8
[ https://issues.apache.org/jira/browse/BEAM-9755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17089129#comment-17089129 ] yoshiki obata commented on BEAM-9755: - Thank you [~tvalentyn] and [~udim]! I found that cause of this seems to be MAP_ADD's stack order expectation change(PEP 572). We can fix this with changing key and value pop order at apache_beam.typehints.opcodes.mapp_add according to Python version. > infer_return_type does not infer as expected in Python 3.8 > -- > > Key: BEAM-9755 > URL: https://issues.apache.org/jira/browse/BEAM-9755 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: yoshiki obata >Assignee: yoshiki obata >Priority: Major > > apache_beam.typehints.trivial_inference.infer_return_type does not return > type as expected in Python 3.8. > And this cause testDictComprehensionSimple > (apache_beam.typehints.trivial_inference_test.TrivialInferenceTest) FAIL. > - Python 3.7.7 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[str, int]{code} > - Python 3.8.2 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[int, str]{code} > > CPython bytecode changes[1] may affect. > [1] https://docs.python.org/3/whatsnew/3.8.html -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (BEAM-9755) infer_return_type does not infer as expected in Python 3.8
[ https://issues.apache.org/jira/browse/BEAM-9755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17088934#comment-17088934 ] Udi Meiri commented on BEAM-9755: - Let me know if you want me to take a look > infer_return_type does not infer as expected in Python 3.8 > -- > > Key: BEAM-9755 > URL: https://issues.apache.org/jira/browse/BEAM-9755 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: yoshiki obata >Assignee: yoshiki obata >Priority: Major > > apache_beam.typehints.trivial_inference.infer_return_type does not return > type as expected in Python 3.8. > And this cause testDictComprehensionSimple > (apache_beam.typehints.trivial_inference_test.TrivialInferenceTest) FAIL. > - Python 3.7.7 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[str, int]{code} > - Python 3.8.2 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[int, str]{code} > > CPython bytecode changes[1] may affect. > [1] https://docs.python.org/3/whatsnew/3.8.html -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (BEAM-9755) infer_return_type does not infer as expected in Python 3.8
[ https://issues.apache.org/jira/browse/BEAM-9755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17088930#comment-17088930 ] Udi Meiri commented on BEAM-9755: - Not surprising, as trivial_inference is tightly coupled to the bytecode implementation (CPython). > infer_return_type does not infer as expected in Python 3.8 > -- > > Key: BEAM-9755 > URL: https://issues.apache.org/jira/browse/BEAM-9755 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: yoshiki obata >Assignee: yoshiki obata >Priority: Major > > apache_beam.typehints.trivial_inference.infer_return_type does not return > type as expected in Python 3.8. > And this cause testDictComprehensionSimple > (apache_beam.typehints.trivial_inference_test.TrivialInferenceTest) FAIL. > - Python 3.7.7 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[str, int]{code} > - Python 3.8.2 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[int, str]{code} > > CPython bytecode changes[1] may affect. > [1] https://docs.python.org/3/whatsnew/3.8.html -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (BEAM-9755) infer_return_type does not infer as expected in Python 3.8
[ https://issues.apache.org/jira/browse/BEAM-9755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17088852#comment-17088852 ] Valentyn Tymofieiev commented on BEAM-9755: --- cc: [~udim] who may be able to help or advise here. > infer_return_type does not infer as expected in Python 3.8 > -- > > Key: BEAM-9755 > URL: https://issues.apache.org/jira/browse/BEAM-9755 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core >Reporter: yoshiki obata >Assignee: yoshiki obata >Priority: Major > > apache_beam.typehints.trivial_inference.infer_return_type does not return > type as expected in Python 3.8. > And this cause testDictComprehensionSimple > (apache_beam.typehints.trivial_inference_test.TrivialInferenceTest) FAIL. > - Python 3.7.7 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[str, int]{code} > - Python 3.8.2 > {code:python} > >> from apache_beam.typehints.trivial_inference import infer_return_type > >> infer_return_type(lambda _list: {'a': 1 for _ in _list}, [], debug=False, > depth=5) > Dict[int, str]{code} > > CPython bytecode changes[1] may affect. > [1] https://docs.python.org/3/whatsnew/3.8.html -- This message was sent by Atlassian Jira (v8.3.4#803005)