[
https://issues.apache.org/jira/browse/BEAM-12920?focusedWorklogId=723842&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-723842
]
ASF GitHub Bot logged work on BEAM-12920:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 09/Feb/22 17:28
Start Date: 09/Feb/22 17:28
Worklog Time Spent: 10m
Work Description: codecov[bot] commented 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%`.
[](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/runtime/exec/datasource.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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9kYXRhc291cmNlLmdv)
| | |
|
[sdks/go/pkg/beam/metrics.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-c2Rrcy9nby9wa2cvYmVhbS9tZXRyaWNzLmdv)
| | |
|
[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/core/graph/bind.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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL2JpbmQuZ28=)
| | |
|
[sdks/go/pkg/beam/testing/passert/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-c2Rrcy9nby9wa2cvYmVhbS90ZXN0aW5nL3Bhc3NlcnQvaGFzaC5nbw==)
| | |
|
[sdks/go/pkg/beam/testing/teststream/teststream.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-c2Rrcy9nby9wa2cvYmVhbS90ZXN0aW5nL3Rlc3RzdHJlYW0vdGVzdHN0cmVhbS5nbw==)
| | |
|
[sdks/go/pkg/beam/core/graph/fn.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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL2ZuLmdv)
| | |
|
[sdks/go/pkg/beam/beam.shims.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-c2Rrcy9nby9wa2cvYmVhbS9iZWFtLnNoaW1zLmdv)
| | |
|
[.../go/pkg/beam/core/graph/coder/testutil/testutil.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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL2dyYXBoL2NvZGVyL3Rlc3R1dGlsL3Rlc3R1dGlsLmdv)
| | |
| ... 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: 723842)
Time Spent: 0.5h (was: 20m)
> 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: 0.5h
> 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)