shikhabhadoria opened a new pull request, #41392:
URL: https://github.com/apache/beam/pull/41392
Fixes #41349.
### Description
In Beam YAML, `AssignTimestamps`
(`sdks/python/apache_beam/yaml/yaml_mapping.py`) previously passed the raw
result of `timestamp_fn(x)` directly to `TimestampedValue(x, timestamp_fn(x))`,
which failed with `TypeError` on RFC-3339 / ISO-8601 timestamp strings and
`ValueError` on naive or non-UTC `datetime.datetime` objects.
This change adds `_to_timestamp` in `yaml_mapping.py` to convert ISO-8601 /
RFC-3339 strings and `datetime.datetime` objects into
`beam.utils.timestamp.Timestamp` before constructing `TimestampedValue`.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
- [x] Replace these instructions with a description of your change and why
you have made it.
- [x] Mention the appropriate issue in your description (for example:
`addresses #123` or `fixes #456`).
- [ ] Update `CHANGES.md` with noteworthy changes.
--
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]