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

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

                Author: ASF GitHub Bot
            Created on: 04/Jun/19 16:27
            Start Date: 04/Jun/19 16:27
    Worklog Time Spent: 10m 
      Work Description: aaltay commented on pull request #8739: BEAM-7141: add 
key value timer callback
URL: https://github.com/apache/beam/pull/8739#discussion_r290385191
 
 

 ##########
 File path: sdks/python/apache_beam/runners/common.py
 ##########
 @@ -183,6 +184,8 @@ def __init__(self, obj_to_invoke, method_name):
         self.timestamp_arg_name = kw
       elif v == core.DoFn.WindowParam:
         self.window_arg_name = kw
+      elif v == core.DoFn.KeyParam:
 
 Review comment:
   You have a valid a point. There may not always be a key that can be passed 
to process() method. Although sometimes there might be.
   
   Now that we have a KeyParam, a user might right a process method using that 
e.g. (process(mykey=KeyParam). What would be the reasonable thing to do in this 
case:
   
   1. We can do nothing and mykey will literally have the value KeyParam.
   2. We can fail with an error saying that KeyParam is not a valid parameter 
for process method.
   3. We can try to pass the key (e.g. k, v = element) and set mykey = k. And 
if that fails (i.e. element is not a K,V) we can fail.
   
   I was leaning towards the third option. I think second option would also be 
fine and the first option will be confusing.
   
   What do you think?
 
----------------------------------------------------------------
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: 253837)
    Time Spent: 5h  (was: 4h 50m)

> Expose kv and window parameters for on_timer
> --------------------------------------------
>
>                 Key: BEAM-7141
>                 URL: https://issues.apache.org/jira/browse/BEAM-7141
>             Project: Beam
>          Issue Type: Improvement
>          Components: sdk-py-core
>    Affects Versions: 2.12.0
>            Reporter: Thomas Weise
>            Assignee: Rakesh Kumar
>            Priority: Major
>          Time Spent: 5h
>  Remaining Estimate: 0h
>
> We would like to have access to key and window inside the timer callback. 
> Without, it is also difficult to debug. We run into this while working onĀ 
> BEAM-7112



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to