New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BEAM-3382] Enforce strictly positive natural numbers for AfterCount timers #4300
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
import collections | ||
import copy | ||
import itertools | ||
import numbers | ||
from abc import ABCMeta | ||
from abc import abstractmethod | ||
|
||
|
@@ -378,6 +379,8 @@ class AfterCount(TriggerFn): | |
COUNT_TAG = _CombiningValueStateTag('count', combiners.CountCombineFn()) | ||
|
||
def __init__(self, count): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am not sure if it affects other SDKs, but I have now filed BEAM-3382 for sdk-py-core There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Done. |
||
if not isinstance(count, numbers.Integral) or count < 1: | ||
raise ValueError("count (%d) must be a positive integer." % count) | ||
self.count = count | ||
|
||
def __repr__(self): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps also have a JIRA issue, so that this can be fixed in other sdks.