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

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

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


   # 
[Codecov](https://codecov.io/gh/apache/beam/pull/16517?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 
[#16517](https://codecov.io/gh/apache/beam/pull/16517?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (1731db4) into 
[master](https://codecov.io/gh/apache/beam/commit/872455570ae7f3e2e35360bccf93b503ae9fdb5c?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
 (8724555) will **increase** coverage by `9.02%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree 
graph](https://codecov.io/gh/apache/beam/pull/16517/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/16517?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   #16517      +/-   ##
   ==========================================
   + Coverage   74.62%   83.64%   +9.02%     
   ==========================================
     Files         653      452     -201     
     Lines       81798    62168   -19630     
   ==========================================
   - Hits        61040    52001    -9039     
   + Misses      19777    10167    -9610     
   + Partials      981        0     -981     
   ```
   
   
   | [Impacted 
Files](https://codecov.io/gh/apache/beam/pull/16517?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/transforms/ptransform.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vdHJhbnNmb3Jtcy9wdHJhbnNmb3JtLnB5)
 | `93.54% <ø> (ø)` | |
   | 
[...pache\_beam/dataframe/pandas\_top\_level\_functions.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vZGF0YWZyYW1lL3BhbmRhc190b3BfbGV2ZWxfZnVuY3Rpb25zLnB5)
 | `90.52% <0.00%> (-3.16%)` | :arrow_down: |
   | 
[...n/apache\_beam/runners/interactive/cache\_manager.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9jYWNoZV9tYW5hZ2VyLnB5)
 | `88.59% <0.00%> (-2.39%)` | :arrow_down: |
   | 
[...beam/runners/interactive/background\_caching\_job.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9iYWNrZ3JvdW5kX2NhY2hpbmdfam9iLnB5)
 | `94.26% <0.00%> (-2.29%)` | :arrow_down: |
   | 
[sdks/python/apache\_beam/io/source\_test\_utils.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vc291cmNlX3Rlc3RfdXRpbHMucHk=)
 | `88.01% <0.00%> (-1.85%)` | :arrow_down: |
   | 
[...eam/runners/interactive/interactive\_environment.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS9pbnRlcmFjdGl2ZV9lbnZpcm9ubWVudC5weQ==)
 | `90.40% <0.00%> (-1.33%)` | :arrow_down: |
   | 
[sdks/python/apache\_beam/internal/metrics/metric.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW50ZXJuYWwvbWV0cmljcy9tZXRyaWMucHk=)
 | `90.00% <0.00%> (-1.00%)` | :arrow_down: |
   | 
[...hon/apache\_beam/runners/direct/test\_stream\_impl.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9kaXJlY3QvdGVzdF9zdHJlYW1faW1wbC5weQ==)
 | `93.28% <0.00%> (-0.75%)` | :arrow_down: |
   | 
[...ks/python/apache\_beam/runners/interactive/utils.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vcnVubmVycy9pbnRlcmFjdGl2ZS91dGlscy5weQ==)
 | `94.85% <0.00%> (-0.60%)` | :arrow_down: |
   | 
[setup.py](https://codecov.io/gh/apache/beam/pull/16517/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-c2V0dXAucHk=)
 | `0.00% <0.00%> (ø)` | |
   | ... and [224 
more](https://codecov.io/gh/apache/beam/pull/16517/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/16517?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/16517?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 
[8724555...1731db4](https://codecov.io/gh/apache/beam/pull/16517?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: 722076)
    Time Spent: 2h 50m  (was: 2h 40m)

> Correct type signature on ptransform_fn to better support typecheckers
> ----------------------------------------------------------------------
>
>                 Key: BEAM-13439
>                 URL: https://issues.apache.org/jira/browse/BEAM-13439
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>    Affects Versions: 2.34.0
>            Reporter: Sandy Chapman
>            Priority: P2
>              Labels: transform, typecheck
>          Time Spent: 2h 50m
>  Remaining Estimate: 0h
>
> Because the return type of the ptransform_fn is not specified, [certain 
> typecheckers|https://github.com/microsoft/pyright/issues/2688#issuecomment-990238720]
>  will assume the type signature of functions decorated with it remain 
> unchanged. However, ptransform_fn specifically adjusts the type signature 
> such that the function no longer takes a pcoll.
> This can be corrected by changing the the definition of ptransform_fn from:
> {code:python}
> def ptransform_fn(fn):
> {code}
> to:
> {code:python}
> def ptransform_fn(fn) -> Callable[..., _PTransformFnPTransform]: {code}
> This allows the typechecker to understand the return type of a function 
> decorated with ptransform_fn will instead be a _PTransformFnPTransform type.
> Additionally, for Python 3.10, 
> [ParamSpec|https://www.python.org/dev/peps/pep-0612/#parameter-specification-variables]
>  could be used to preserve the signature of the internal function as well.
> {code:python}
> from typing import ParamSpec, TypeVar, Concatenate
> P = ParamSpec("P")
> T = TypeVar("T")
> R = TypeVar("R")
> def ptransform_fn(fn: Callable[Concatenate[PCollection[T], P], R]) -> 
> Callable[[P], _PTransformFnPTransform]: ...{code}



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

Reply via email to