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

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

                Author: ASF GitHub Bot
            Created on: 09/Feb/22 17:57
            Start Date: 09/Feb/22 17:57
    Worklog Time Spent: 10m 
      Work Description: codecov[bot] edited a comment on pull request #16791:
URL: https://github.com/apache/beam/pull/16791#issuecomment-1034014533


   # 
[Codecov](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 Report
   > Merging 
[#16791](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (e26c2b5) into 
[master](https://codecov.io/gh/apache/beam/commit/d7ee6b8c8b4fedb05d31d6554ab55a6d4bca0356?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (d7ee6b8) will **increase** coverage by `36.82%`.
   > The diff coverage is `0.00%`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/beam/pull/16791/graphs/tree.svg?width=650&height=150&src=pr&token=qcbbAh8Fj1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff             @@
   ##           master   #16791       +/-   ##
   ===========================================
   + Coverage   46.79%   83.61%   +36.82%     
   ===========================================
     Files         203      452      +249     
     Lines       20044    62233    +42189     
   ===========================================
   + Hits         9379    52037    +42658     
   - Misses       9665    10196      +531     
   + Partials     1000        0     -1000     
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | Coverage Δ | |
   |---|---|---|
   | 
[...apache\_beam/typehints/native\_type\_compatibility.py](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHlwZWhpbnRzL25hdGl2ZV90eXBlX2NvbXBhdGliaWxpdHkucHk=)
 | `86.57% <0.00%> (ø)` | |
   | 
[sdks/go/pkg/beam/core/metrics/dumper.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL21ldHJpY3MvZHVtcGVyLmdv)
 | | |
   | 
[sdks/go/pkg/beam/runners/direct/direct.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9ydW5uZXJzL2RpcmVjdC9kaXJlY3QuZ28=)
 | | |
   | 
[sdks/go/pkg/beam/combine.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb21iaW5lLmdv)
 | | |
   | 
[sdks/go/pkg/beam/testing/passert/passert.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS90ZXN0aW5nL3Bhc3NlcnQvcGFzc2VydC5nbw==)
 | | |
   | 
[sdks/go/pkg/beam/core/runtime/exec/hash.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9oYXNoLmdv)
 | | |
   | 
[sdks/go/pkg/beam/util/harnessopts/sampler.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS91dGlsL2hhcm5lc3NvcHRzL3NhbXBsZXIuZ28=)
 | | |
   | 
[sdks/go/pkg/beam/core/graph/coder/panes.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL2NvZGVyL3BhbmVzLmdv)
 | | |
   | 
[sdks/go/pkg/beam/core/runtime/exec/pardo.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9wYXJkby5nbw==)
 | | |
   | 
[sdks/go/pkg/beam/core/util/reflectx/calls.go](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3V0aWwvcmVmbGVjdHgvY2FsbHMuZ28=)
 | | |
   | ... and [646 
more](https://codecov.io/gh/apache/beam/pull/16791/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 | |
   
   ------
   
   [Continue to review full report at 
Codecov](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn 
more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by 
[Codecov](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Last update 
[d7ee6b8...e26c2b5](https://codecov.io/gh/apache/beam/pull/16791?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
 Read the [comment 
docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 723858)
    Time Spent: 40m  (was: 0.5h)

> Convert To Bare Types Fails on Generators in Python 3.9
> -------------------------------------------------------
>
>                 Key: BEAM-12920
>                 URL: https://issues.apache.org/jira/browse/BEAM-12920
>             Project: Beam
>          Issue Type: Sub-task
>          Components: sdk-py-core
>    Affects Versions: 2.32.0
>         Environment: Python 3.9.7
> Linux Mint 20.2, Kernel: 5.4.0-84-generic
>            Reporter: Jonathan Hourany
>            Assignee: Valentyn Tymofieiev
>            Priority: P2
>             Fix For: Not applicable
>
>          Time Spent: 40m
>  Remaining Estimate: 0h
>
> In Python 3.9 the test 
> [test_convert_bare_types|https://github.com/apache/beam/blob/6c1c19d6c711babf5f5f042fa465be20948caff6/sdks/python/apache_beam/typehints/native_type_compatibility.py#L40]
>  fails when testing the following Generator test case
> {code:python}
> test_cases += [
>           (
>               'bare generator',
>               typing.Generator,
>               typehints.Generator[typehints.TypeVariable('T_co')]),
>       ]
> {code}
> Raising the following {{ValueError}}
> {noformat}
> ./sdks/python/apache_beam/typehints/native_type_compatibility_test.py::NativeTypeCompatibilityTest::test_convert_bare_types
>  Failed: [undefined]ValueError: Unsupported Generator with no arguments.
> {noformat}
> ----
> The immediate cause may be stemming from 
> [_get_args|https://github.com/apache/beam/blob/6c1c19d6c711babf5f5f042fa465be20948caff6/sdks/python/apache_beam/typehints/native_type_compatibility.py#L40]
>  which attempts to access a type's ___args___ attribute. In Python 3.9 bare 
> generators no longer instantiate with a default ___args___ attribute. Only 
> when instantiated with args do they get one (see example below).
> However,  despite it's name the test doesn't create a generator that's 
> totally bare, so the deeper cause may be coming from the way 
> {{typinghints.Generator}} is constructed.
> h3. Examples
> {code:python}
> # Python 3.7.5
> In [1]: from typing import Generator
> In [2]: Generator.__args__
> Out[2]: (+T_co, -T_contra, +V_co)
> {code}
> ----
> {code:python}
> # Python 3.9.7
> In [1]: from typing import Generator
> In [2]: Generator.__args__
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
> <ipython-input-2-3e272b948083> in <module>
> ----> 1 Generator.__args__
> ~/.pyenv/versions/3.9.7/lib/python3.9/typing.py in __getattr__(self, attr)
>     704         if '__origin__' in self.__dict__ and not _is_dunder(attr):
>     705             return getattr(self.__origin__, attr)
> --> 706         raise AttributeError(attr)
>     707 
>     708     def __setattr__(self, attr, val):
> AttributeError: __args__
> In [3]: # Initializing with args, however, creates the needed attr
> In [4]: Generator[int, int, int].__args__
> Out[4]: (int, int, int)
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to