Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tolerate timestamps w/ truncated nanos. #1785

Merged
merged 2 commits into from
May 12, 2016
Merged

Tolerate timestamps w/ truncated nanos. #1785

merged 2 commits into from
May 12, 2016

Conversation

tseaver
Copy link
Contributor

@tseaver tseaver commented May 10, 2016

Closes #1783.

@tseaver tseaver added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. api: core labels May 10, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label May 10, 2016
with self.assertRaises(ValueError):
self._callFUT(dt_str)
truncateds_and_micros = [
('12345678', 123456),

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@rimey
Copy link
Contributor

rimey commented May 10, 2016

I don't have the bandwidth right now to follow this properly, but have you guys looked at the proto3 JSON mapping spec for Timestamp and the Timestamp class in google.protobuf. Could we use that library's support for JSON serialization and deserialization of the well-known type Timestamp?

@dhermes
Copy link
Contributor

dhermes commented May 10, 2016

Possibly, the phrase

Uses RFC 3339, where generated output will always be Z-normalized and uses 3, 6 or 9 fractional digits.

may actually shed some light on what we've seen empirically.

@tseaver
Copy link
Contributor Author

tseaver commented May 12, 2016

@dhermes Seems like you didn't find a counter-example to the "truncate/floor to micros" bit.

@dhermes
Copy link
Contributor

dhermes commented May 12, 2016

Yeah LGTM

@tseaver tseaver merged commit cd8e645 into googleapis:master May 12, 2016
@tseaver tseaver deleted the 1783-timestamp_nanos_truncated branch May 12, 2016 23:00
@tseaver tseaver mentioned this pull request May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: core cla: yes This human has signed the Contributor License Agreement. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants