[ https://issues.apache.org/jira/browse/BEAM-6988?focusedWorklogId=241258&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241258 ]
ASF GitHub Bot logged work on BEAM-6988: ---------------------------------------- Author: ASF GitHub Bot Created on: 13/May/19 20:08 Start Date: 13/May/19 20:08 Worklog Time Spent: 10m Work Description: NikeNano commented on issue #8530: [BEAM-6988] solved problem related to updates of the str object URL: https://github.com/apache/beam/pull/8530#issuecomment-491964785 BACKGROUND: I thought I understood the reason for the error(thought it was due to difference in str.split in python2 vs python3) and changed in the test. However @tvalentyn pointed out that that was not the case. Thus it is unclear why it fails and changing in the test is not a good solution. The test fails in ["/beam/sdks/python/apache_beam/typehints/decorators.py"](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/typehints/decorators.py), line 281 , in getcallargs_forhints" when calling the function inspect.getcallargs(func, *packed_typeargs, **typekwargs). This function fails due to that in python3 to few positional arguments one are passed where two args are need(self,chars). This result in that the test fails with the error strip() missing 1 required positional argument: 'chars'. In python 2 one positional argument is passed and one arg is required. I would be very happy for some help on this @udim(know you mentioned earlier you would be happy to help) since I can't figure it out. Have really tried my best :) What i have figured out: - There is a difference in the inspect.getcallargs between python2 and python3 - There seams to be a difference in the required arguments when using str.split in python2 vs python3 If you have any tips/questions/advice on how to solve it, let me know :) ---------------------------------------------------------------- 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: 241258) Time Spent: 1h 40m (was: 1.5h) > TypeHints Py3 Error: test_non_function > (apache_beam.typehints.typed_pipeline_test.MainInputTest) Fails on Python 3.7+ > --------------------------------------------------------------------------------------------------------------------- > > Key: BEAM-6988 > URL: https://issues.apache.org/jira/browse/BEAM-6988 > Project: Beam > Issue Type: Sub-task > Components: sdk-py-core > Reporter: Robbe > Assignee: niklas Hansson > Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > {noformat} > Traceback (most recent call last): > File > "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/typehints/typed_pipeline_test.py", > line 53, in test_non_function > result = ['xa', 'bbx', 'xcx'] | beam.Map(str.strip, 'x') > File > "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/transforms/ptransform.py", > line 510, in _ror_ > result = p.apply(self, pvalueish, label) > File > "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/pipeline.py", > line 514, in apply > transform.type_check_inputs(pvalueish) > File > "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/transforms/ptransform.py", > line 753, in type_check_inputs > hints = getcallargs_forhints(argspec_fn, *type_hints[0], **type_hints[1]) > File > "/home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py37/build/srcs/sdks/python/apache_beam/typehints/decorators.py", > line 283, in getcallargs_forhints > raise TypeCheckError(e) > apache_beam.typehints.decorators.TypeCheckError: strip() missing 1 required > positional argument: 'chars'{noformat} -- This message was sent by Atlassian JIRA (v7.6.3#76005)