aaltay commented on a change in pull request #14446:
URL: https://github.com/apache/beam/pull/14446#discussion_r608048426



##########
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:
       Should they be always Timestamps to avoid isinstance checks?

##########
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 do not believe we want to add another field to keep track of the same 
information. A few options:
   - In periodicsequence.py read micros and convert to seconds there.
   - hava an attribute on Timestamp here to return seconds from the internally 
stored micros.
   
   (same for the Duration change below)




-- 
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]


Reply via email to