InigoSJ commented on a change in pull request #14446:
URL: https://github.com/apache/beam/pull/14446#discussion_r608441854
##########
File path: sdks/python/apache_beam/utils/timestamp.py
##########
@@ -66,6 +66,7 @@ def __init__(self, seconds=0, micros=0):
raise TypeError(
'Cannot interpret %s %s as micros.' % (micros, type(micros)))
self.micros = int(seconds * 1000000) + int(micros)
+ self.seconds = seconds + micros / 1000000
Review comment:
I have coded both options and I think the first approach looks better
and more compact. I will push the version that changes to seconds directly in
`periodicsequence`
##########
File path: sdks/python/apache_beam/transforms/periodicsequence.py
##########
@@ -37,6 +37,11 @@
class ImpulseSeqGenRestrictionProvider(core.RestrictionProvider):
def initial_restriction(self, element):
start, end, interval = element
+ if isinstance(start, Timestamp):
Review comment:
Reviewing the code, our current tests use `time.time()` which return a
float, I think we should not change it to only allow `Timestamps`. 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]