[
https://issues.apache.org/jira/browse/BEAM-7141?focusedWorklogId=244792&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-244792
]
ASF GitHub Bot logged work on BEAM-7141:
----------------------------------------
Author: ASF GitHub Bot
Created on: 20/May/19 04:17
Start Date: 20/May/19 04:17
Worklog Time Spent: 10m
Work Description: rakeshcusat commented on pull request #8408:
[BEAM-7141] Add window & timestamp in timer callback method argument
URL: https://github.com/apache/beam/pull/8408#discussion_r285424892
##########
File path: sdks/python/apache_beam/transforms/userstate_test.py
##########
@@ -498,6 +502,39 @@ def process(self, element, ts=DoFn.TimestampParam):
[('timer1', 10), ('timer2', 20), ('timer3', 30)],
sorted(StatefulDoFnOnDirectRunnerTest.all_records))
+ def test_timer_output_timestamp_and_window(self):
+
+ class TimerEmittingStatefulDoFn(DoFn):
+ EMIT_TIMER_1 = TimerSpec('emit1', TimeDomain.WATERMARK)
+
+ def process(self, element, timer1=DoFn.TimerParam(EMIT_TIMER_1)):
+ timer1.set(10)
+
+ @on_timer(EMIT_TIMER_1)
+ def emit_callback_1(self,
+ window=DoFn.WindowParam,
+ ts=DoFn.TimestampParam):
+ yield ('timer1', int(ts), int(window.start), int(window.end))
+
+ pipeline_options = PipelineOptions()
+ pipeline_options.view_as(StandardOptions).streaming = True
Review comment:
just removed it.
----------------------------------------------------------------
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: 244792)
Time Spent: 2.5h (was: 2h 20m)
> 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: 2.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)