Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f0f7a42 commit 640e8dfCopy full SHA for 640e8df
1 file changed
sdks/python/apache_beam/transforms/periodicsequence.py
@@ -192,11 +192,15 @@ def __init__(
192
self.apply_windowing = apply_windowing
193
194
def expand(self, pbegin):
195
- result = (
+ sequence = (
196
pbegin
197
| 'ImpulseElement' >> beam.Create(
198
[(self.start_ts, self.stop_ts, self.interval)])
199
- | 'GenSequence' >> beam.ParDo(ImpulseSeqGenDoFn())
+ | 'GenSequence' >> beam.ParDo(ImpulseSeqGenDoFn()))
200
+ if self.stop_ts - self.start_ts < 5:
201
+ sequence.is_bounded = True
202
+ result = (
203
+ sequence
204
| 'MapToTimestamped' >> beam.Map(lambda tt: TimestampedValue(tt, tt)))
205
if self.apply_windowing:
206
result = result | 'ApplyWindowing' >> beam.WindowInto(
0 commit comments