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

Make python timezone conversions handle more cases #5249

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

chipkent
Copy link
Member

Resolves #4723

@chipkent chipkent added bug Something isn't working NoDocumentationNeeded ReleaseNotesNeeded Release notes are needed devrel-watch DevRel team is watching labels Mar 13, 2024
@chipkent chipkent added this to the 1. March 2024 milestone Mar 13, 2024
@chipkent chipkent self-assigned this Mar 13, 2024
jmao-denver
jmao-denver previously approved these changes Mar 15, 2024

# Try to get the time zone from the zone name
try:
return _JDateTimeUtils.parseTimeZone(str(tzi))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

datetime.tzinfo is an abstract class, so I'm not sure str(tzi) is guaranteed to be well-defined. It looks like tzinfo does not define a method for string conversion, so you hope that the subclass does: https://github.com/python/cpython/blob/a76288ad9ba715216a29c89e046846b3eaf0fab7/Lib/_pydatetime.py#L1231

py/server/tests/test_time.py Show resolved Hide resolved
Copy link
Contributor

@alexpeters1208 alexpeters1208 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chipkent chipkent merged commit e5b78e2 into deephaven:main Mar 18, 2024
19 checks passed
@chipkent chipkent deleted the python_to_j_time_zone branch March 18, 2024 20:14
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2024
@chipkent chipkent removed the devrel-watch DevRel team is watching label May 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working NoDocumentationNeeded ReleaseNotesNeeded Release notes are needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

to_j_time_zone() does not support common aliases and thus fails on some pd.Timestamp calls
3 participants