-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Review the datetime helpers in gcloud._helpers. #1732
Comments
@tseaver you have a better feel for Some context for the overall number of methods, we essentially have to support all of the flavors of datetime from the various Google APIs:
|
Part of the broader context here is time zone usage in the library's Python interface. I would suggest the following guidelines for this library:
Naive |
To date, we have strongly preferred to avoid naive datetimes: the presumed ease-of-use goes away when dealing with an API which requires that the zone be explicit. In cases where we have accepted them from the caller, we have forcibly converted it before working with it further. Where an API returns a string timestamp, we also forcibly convert it. We use |
What APIs require "that the zone be explicit"? It's hard to imagine this being very common, given how the Python standard library doesn't provide a time zone implementation. |
(See #1044 for the history of "our own forked version". I was hoping to find the reference I used when creating it, but I can't track it down.) |
Introducing your own UTC #1706 came up because installing Touching time zones at only a small number of choke points in the code is the right answer, if one must touch them at all. |
@rimey The APIs document that the timestamps being pushed across the wire are in UTC: Datastore
Storage
Pubsub
BigQuery
Logging
DNS
|
Hello, As part of trying to get things under control (as well as to empower us to provide better customer service in the future), I am declaring a "bankruptcy" of sorts on many of the old issues, especially those likely to have been addressed or made obsolete by more recent updates. My goal is to close stale issues whose relevance or solution is no longer immediately evident, and which appear to be of lower importance. I believe in good faith that this is one of those issues, but I am scanning quickly and may occasionally be wrong. If this is an issue of high importance, please comment here and we will reconsider. If this is an issue whose solution is trivial, please consider providing a pull request. Thank you! |
gcloud._helpers
has accumulated a collection of ~10 helper functions related todatetime
handling. These could perhaps use a review to determine if they are all essential and maximally useful.The particular situation in which this has come up is a proposal to update
_datetime_to_rfc3339()
to handle time zones as in the following module-private helper function appearing in #1691:The text was updated successfully, but these errors were encountered: