dianfu commented on code in PR #29286:
URL: https://github.com/apache/flink/pull/29286#discussion_r4310839629
##########
flink-python/pyflink/fn_execution/datastream/embedded/operations.py:
##########
@@ -211,7 +213,8 @@ def on_timer_func(timestamp):
yield from process_func(on_timer(timestamp, timer_context))
return TwoInputOperation(
- open_func, close_func, process_element_func1,
process_element_func2, on_timer_func)
+ open_func, close_func, process_element_func1,
process_element_func2,
+ on_timer_func if on_timer else None)
Review Comment:
Could we revert this change and handle the missing callback inside
`on_timer_func`?
For example, the new test registers an event-time timer at 3 without
defining `on_timer`. In thread mode, when the watermark reaches 3,
`TwoInputOperation.on_timer()` returns `None`, which becomes Java `null`.
`EmbeddedPythonIterator.from(null)` then throws an NPE. We still need an empty
generator when the user callback is absent.
--
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]