lostluck commented on a change in pull request #15430:
URL: https://github.com/apache/beam/pull/15430#discussion_r703715963
##########
File path: sdks/go/pkg/beam/core/runtime/graphx/translate.go
##########
@@ -1061,12 +1061,11 @@ func makeTrigger(t window.Trigger) *pipepb.Trigger {
},
}
case window.AfterEndOfWindowTrigger:
- // TODO: change it to take user config triggers for early and
late firings
return &pipepb.Trigger{
Trigger: &pipepb.Trigger_AfterEndOfWindow_{
AfterEndOfWindow:
&pipepb.Trigger_AfterEndOfWindow{
- EarlyFirings:
makeTrigger(window.Trigger{Kind: window.ElementCountTrigger, ElementCount: 1}),
- LateFirings: nil,
+ EarlyFirings:
makeTrigger(*t.EarlyTrigger),
+ LateFirings:
makeTrigger(*t.LateTrigger),
Review comment:
Consider constructing these just before, if the fields aren't nil and
then assigning the variables to the proto. Right now it's at risk of nil
pointer dereferences as EarlyTrigger or LateTrigger could be nil.
After all, according to the proto, both early and late firing clauses are
optional.
--
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]