liferoad opened a new issue, #27036:
URL: https://github.com/apache/beam/issues/27036
### What happened?
With this test code,
```
import time
import apache_beam as beam
from apache_beam.transforms import trigger, window
from apache_beam.transforms.periodicsequence import PeriodicImpulse
from apache_beam.utils.timestamp import Timestamp
with beam.Pipeline() as p:
input = (
p
| PeriodicImpulse(
start_timestamp=time.time(),
stop_timestamp=time.time() + 6,
fire_interval=1,
apply_windowing=False,
)
| beam.Map(lambda x: "test")
| beam.transforms.util.LogElements()
| beam.WindowInto(
window.GlobalWindows(),
trigger=trigger.Repeatedly(trigger.AfterCount(1)),
accumulation_mode=trigger.AccumulationMode.DISCARDING,
)
| beam.combiners.Count.Globally()
| "Print Windows"
>> beam.transforms.util.LogElements(with_timestamp=True,
with_window=True)
)
```
it crashes with:
```
File
~/PlayGround/venv-beam-2-43-0/lib/python3.9/site-packages/apache_beam/utils/timestamp.py:163,
in Timestamp.to_utc_datetime(self)
159 def to_utc_datetime(self):
160 # type: () -> datetime.datetime
161 # We can't easily construct a datetime object from microseconds,
so we
162 # create one at the epoch and add an appropriate timedelta
interval.
--> 163 return self._epoch_datetime_utc().replace(tzinfo=None) +
datetime.timedelta(
164 microseconds=self.micros)
OverflowError: date value out of range [while running '[4]: Print
Windows/ParDo(_LoggingFn)']
```
Removing `with_timestamp=True, with_window=True` from `LogElements` works.
### Issue Priority
Priority: 3 (minor)
### Issue Components
- [X] Component: Python SDK
- [ ] Component: Java SDK
- [ ] Component: Go SDK
- [ ] Component: Typescript SDK
- [ ] Component: IO connector
- [ ] Component: Beam examples
- [ ] Component: Beam playground
- [ ] Component: Beam katas
- [ ] Component: Website
- [ ] Component: Spark Runner
- [ ] Component: Flink Runner
- [ ] Component: Samza Runner
- [ ] Component: Twister2 Runner
- [ ] Component: Hazelcast Jet Runner
- [ ] Component: Google Cloud Dataflow Runner
--
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]