[
https://issues.apache.org/jira/browse/BEAM-5878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16894938#comment-16894938
]
Valentyn Tymofieiev commented on BEAM-5878:
-------------------------------------------
[~yoshiki.obata], feel free to work on this, no one is actively working on this
issue at the moment. I am not sure how hard it is it to make it work with dill
pickler, and we have not transitioned to CloudPickle yet.
https://github.com/apache/beam/pull/8505 adds tests for kwonly arguments, we
temporarily reverted it because it broke postcommit tests (related:
https://issues.apache.org/jira/browse/BEAM-7836). These tests can be helpful to
understand which places in Beam need changes, and we will need to add them back
at some point. We can try to run these tests with
https://github.com/apache/beam/pull/8978, although
https://github.com/apache/beam/pull/8978 is not yet ready for merge.
> Support DoFns with Keyword-only arguments in Python 3.
> ------------------------------------------------------
>
> Key: BEAM-5878
> URL: https://issues.apache.org/jira/browse/BEAM-5878
> Project: Beam
> Issue Type: Sub-task
> Components: sdk-py-core
> Reporter: Valentyn Tymofieiev
> Priority: Minor
> Fix For: 2.16.0
>
> Time Spent: 5h
> Remaining Estimate: 0h
>
> Python 3.0 [adds a possibility|https://www.python.org/dev/peps/pep-3102/] to
> define functions with keyword-only arguments.
> Currently Beam does not handle them correctly. [~ruoyu] pointed out [one
> place|https://github.com/apache/beam/blob/a56ce43109c97c739fa08adca45528c41e3c925c/sdks/python/apache_beam/typehints/decorators.py#L118]
> in our codebase that we should fix: in Python in 3.0 inspect.getargspec()
> will fail on functions with keyword-only arguments, but a new method
> [inspect.getfullargspec()|https://docs.python.org/3/library/inspect.html#inspect.getfullargspec]
> supports them.
> There may be implications for our (best-effort) type-hints machinery.
> We should also add a Py3-only unit tests that covers DoFn's with keyword-only
> arguments once Beam Python 3 tests are in a good shape.
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)