[ 
https://issues.apache.org/jira/browse/BEAM-6988?focusedWorklogId=241800&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-241800
 ]

ASF GitHub Bot logged work on BEAM-6988:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/May/19 15:33
            Start Date: 14/May/19 15:33
    Worklog Time Spent: 10m 
      Work Description: fredo838 commented on issue #8530: [BEAM-6988] solved 
problem related to updates of the str object
URL: https://github.com/apache/beam/pull/8530#issuecomment-492191943
 
 
   I tested 
[this](https://github.com/apache/beam/blob/5c7ee600ba8560102f61622c894633955d208f87/sdks/python/apache_beam/typehints/decorators.py#L123-L148)
 function, for python 2.7 - 3.5 - 3.6 - 3.7. 
   
   The result of calling `getfullargspec(str.split)`
   2.7 FullArgSpec(args=['_'],  ...)
   3.5 FullArgSpec(args=['self'],  ...)
   3.6 FullArgSpec(args=['self'],  ...)
   3.7 FullArgSpec(args=['self', 'sep', 'maxsplit],  ...)
   
   Seems that is related to the 'monkeypatch' specified in 
[here](https://github.com/apache/beam/blob/5c7ee600ba8560102f61622c894633955d208f87/sdks/python/apache_beam/typehints/decorators.py#L274),
 which is already an issue in JIRA 
([BEAM-5490])(https://issues.apache.org/jira/browse/BEAM-5490), which was 
partially fixed by [PR-6781](https://github.com/apache/beam/pull/6781), but 
this assumed all python 3 versions behaved the same. Author of this PR is 
@tvalentyn , so I guess that makes a full circle. I think we need to rework the 
typehints file to remove the monkey patch. It shouldn't be necessairy in 
python3.7, because the  `inspect` module _can_ now take str.split as input, 
while it fails on python3.6 and python3.5. But then how would we go about on 
python3.5-3.6? @tvalentyn thoughts? 
   
 
----------------------------------------------------------------
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: 241800)
    Time Spent: 2.5h  (was: 2h 20m)

> 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: 2.5h
>  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)

Reply via email to