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

Extend DateBone to allow for time values with microseconds #790

Open
phorward opened this issue Jul 18, 2023 · 0 comments
Open

Extend DateBone to allow for time values with microseconds #790

phorward opened this issue Jul 18, 2023 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@phorward
Copy link
Member

There are several issues that confuse or point out a todo for a DateBone supporting microseconds. There was also a request from a customer project. Therefore this issue is created.

          > > Okay. I was wrong. The datastore client doesn't throw it away, but the core in the `FileBone` does:

value = value.replace(microsecond=0)

So I don't understand why we have to do this here again.

FileBone? I dont now why throw it away. I implement the old way. May be it's historical. The datastore support microseconds in the timestamp. https://cloud.google.com/datastore/docs/reference/data/rest/Shared.Types/Value

The reason for setting the microseconds to 0 is, that additional, project-specific program code might rely on a datetime-object which is the exact time to seconds, without microseconds. In the past, I had a use-case where this was a big problem and why it was added. microseconds should only be set when the DateBone is in a yet not existing time-with-microseconds-mode.

I would like to take this PR for now as is. We can later change the behavior to respect microseconds when this is configured so.

Originally posted by @phorward in #785 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant