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

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

                Author: ASF GitHub Bot
            Created on: 01/Dec/20 22:05
            Start Date: 01/Dec/20 22:05
    Worklog Time Spent: 10m 
      Work Description: boyuanzz commented on a change in pull request #13431:
URL: https://github.com/apache/beam/pull/13431#discussion_r533751926



##########
File path: sdks/python/apache_beam/runners/common.py
##########
@@ -218,10 +218,11 @@ def __init__(self, obj_to_invoke, method_name):
       elif core.DoFn.KeyParam == v:
         self.key_arg_name = kw
       elif isinstance(v, core.DoFn.RestrictionParam):
-        self.restriction_provider = v.restriction_provider
+        self.restriction_provider = v.restriction_provider or obj_to_invoke

Review comment:
       I understand. The case I'm wondering is like:
   ```python
   class MySDF(beam.DoFn, TypeARestrictionTracker):
     def 
process(restriction_tracker=RestrictionParam(TypeBRestrictionTracker()))
   ```
   
   In this case, the sdk will pick up `TypeBRestrictionTracker` implementation. 
Is it ideal? I thought we want to pick up `TypeARestrictionTracker` in this 
case or just say the DoFn is not valid.




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

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


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

    Worklog Id:     (was: 518674)
    Time Spent: 2h 40m  (was: 2.5h)

>  Allow Splittable DoFn itself to be used as the restriction provider.
> ---------------------------------------------------------------------
>
>                 Key: BEAM-11354
>                 URL: https://issues.apache.org/jira/browse/BEAM-11354
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>            Reporter: Robert Bradshaw
>            Priority: P2
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Binding the provider to the DoFn class itself at construction time can be 
> limiting, we should add an option to use the DoFn instance itself as the 
> restriction provider. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to