[
https://issues.apache.org/jira/browse/BEAM-12914?focusedWorklogId=722493&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-722493
]
ASF GitHub Bot logged work on BEAM-12914:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 08/Feb/22 01:21
Start Date: 08/Feb/22 01:21
Worklog Time Spent: 10m
Work Description: codecov[bot] edited a comment on pull request #16761:
URL: https://github.com/apache/beam/pull/16761#issuecomment-1031732767
#
[Codecov](https://codecov.io/gh/apache/beam/pull/16761?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
[#16761](https://codecov.io/gh/apache/beam/pull/16761?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
(dae6da8) into
[master](https://codecov.io/gh/apache/beam/commit/07e1f84930bfda64cae5a9cad675082225bbe747?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
(07e1f84) will **increase** coverage by `37.15%`.
> The diff coverage is `57.14%`.
[](https://codecov.io/gh/apache/beam/pull/16761?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 #16761 +/- ##
===========================================
+ Coverage 46.45% 83.60% +37.15%
===========================================
Files 202 452 +250
Lines 19914 62223 +42309
===========================================
+ Hits 9251 52022 +42771
- Misses 9674 10201 +527
+ Partials 989 0 -989
```
| [Impacted
Files](https://codecov.io/gh/apache/beam/pull/16761?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
| Coverage Δ | |
|---|---|---|
|
[sdks/python/apache\_beam/typehints/opcodes.py](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHlwZWhpbnRzL29wY29kZXMucHk=)
| `84.00% <54.00%> (ø)` | |
|
[.../python/apache\_beam/typehints/trivial\_inference.py](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHlwZWhpbnRzL3RyaXZpYWxfaW5mZXJlbmNlLnB5)
| `96.41% <83.33%> (ø)` | |
|
[sdks/go/pkg/beam/core/metrics/metrics.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL21ldHJpY3MvbWV0cmljcy5nbw==)
| | |
|
[...pkg/beam/core/runtime/xlangx/expansionx/process.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUveGxhbmd4L2V4cGFuc2lvbngvcHJvY2Vzcy5nbw==)
| | |
|
[sdks/go/pkg/beam/core/runtime/exec/flatten.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy9mbGF0dGVuLmdv)
| | |
|
[sdks/go/pkg/beam/core/runtime/options.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvb3B0aW9ucy5nbw==)
| | |
|
[sdks/go/pkg/beam/core/runtime/harness/harness.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvaGFybmVzcy9oYXJuZXNzLmdv)
| | |
|
[.../go/pkg/beam/core/graph/coder/testutil/testutil.go](https://codecov.io/gh/apache/beam/pull/16761/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)
| | |
|
[sdks/go/pkg/beam/core/runtime/exec/util.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS9jb3JlL3J1bnRpbWUvZXhlYy91dGlsLmdv)
| | |
|
[sdks/go/pkg/beam/transforms/stats/max\_switch.go](https://codecov.io/gh/apache/beam/pull/16761/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-c2Rrcy9nby9wa2cvYmVhbS90cmFuc2Zvcm1zL3N0YXRzL21heF9zd2l0Y2guZ28=)
| | |
| ... and [646
more](https://codecov.io/gh/apache/beam/pull/16761/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/16761?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/16761?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
[07e1f84...dae6da8](https://codecov.io/gh/apache/beam/pull/16761?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: 722493)
Time Spent: 1h 50m (was: 1h 40m)
> Support LIST_EXTEND and LIST_TO_TUPLE opcodes in type inference on Python 3.9
> -----------------------------------------------------------------------------
>
> Key: BEAM-12914
> URL: https://issues.apache.org/jira/browse/BEAM-12914
> 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: Robert Bradshaw
> Priority: P3
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> The order and/or type of opcodes used to build lambda functions have changed
> in Python 3.9 (see example below). This causes the any test that relies on
> `trivial_inference.infer_return_type` to fail because the function returns a
> default of `Any` in cases where the type should normally be inferable. Tests
> cases that fail include:
> *
> [testBuildListUnpack|https://github.com/apache/beam/blob/8072cc0bcfd4eee08a95902e13b9bf1dc2338693/sdks/python/apache_beam/typehints/trivial_inference_test.py#L39]
>
> *
> [testBuildTupleUnpack|https://github.com/apache/beam/blob/8072cc0bcfd4eee08a95902e13b9bf1dc2338693/sdks/python/apache_beam/typehints/trivial_inference_test.py#L45]
> *
> [testBuildTupleUnpackWithCall|https://github.com/apache/beam/blob/8072cc0bcfd4eee08a95902e13b9bf1dc2338693/sdks/python/apache_beam/typehints/trivial_inference_test.py#L305]
> *
> [test_pardo_type_inference|https://github.com/apache/beam/blob/8072cc0bcfd4eee08a95902e13b9bf1dc2338693/sdks/python/apache_beam/transforms/ptransform_test.py#L2540]
> Test failure messages are all variations of:
> {noformat}
> ./sdks/python/apache_beam/transforms/ptransform_test.py::PTransformTypeCheckTestCase::test_pardo_type_inference
> Failed: [undefined]AssertionError: <class 'int'> != Any
> ./sdks/python/apache_beam/typehints/trivial_inference_test.py::TrivialInferenceTest::testBuildListUnpack
> Failed: [undefined]AssertionError: List[int] != Any
> {noformat}
> etc
> h3. Example
> {code:python}
> # Python3.7
> In [1]: from dis import dis
> In [2]: from apache_beam.typehints import typehints
> In [3]: beam_type_hints = [typehints.List[int]]
> In [4]: dis(lambda _list: [*_list, *_list, *_list](beam_type_hints))
> 1 0 LOAD_FAST 0 (_list)
> 2 LOAD_FAST 0 (_list)
> 4 LOAD_FAST 0 (_list)
> 6 BUILD_LIST_UNPACK 3
> 8 LOAD_GLOBAL 0 (beam_type_hints)
> 10 CALL_FUNCTION 1
> 12 RETURN_VALUE
> {code}
> ----
> Whereas in Python 3.9
> {code:python}
> # Python 3.9
> In [1]: from dis import dis
> In [2]: from apache_beam.typehints import typehints
> In [3]: beam_type_hints = [typehints.List[int]]
> In [4]: dis(lambda _list: [*_list, *_list, *_list](beam_type_hints))
> <>:1: SyntaxWarning: 'list' object is not callable; perhaps you missed a
> comma?
> <ipython-input-4-6499114c3d61>:1: SyntaxWarning: 'list' object is not
> callable; perhaps you missed a comma?
> dis(lambda _list: [*_list, *_list, *_list](beam_type_hints))
> 1 0 BUILD_LIST 0
> 2 LOAD_FAST 0 (_list)
> 4 LIST_EXTEND 1
> 6 LOAD_FAST 0 (_list)
> 8 LIST_EXTEND 1
> 10 LOAD_FAST 0 (_list)
> 12 LIST_EXTEND 1
> 14 LOAD_GLOBAL 0 (beam_type_hints)
> 16 CALL_FUNCTION 1
> 18 RETURN_VALUE
> {code}
> The `SyntaxWarning` is most likely raising because enhancment in
> [bpo-15248|https://bugs.python.org/issue15248] misses the fact that the
> lambda expression is a function, not a list we're calling, and isn't relevant
> to the issue.
>
--
This message was sent by Atlassian Jira
(v8.20.1#820001)