Skip to content

[Python] Tzinfo - string roundtrip fails on pytz.StaticTzInfo objects #26018

@asfimport

Description

@asfimport

Timezone roundtrip fails with pytz.StaticTzInfo objects on master:

tz = pytz.timezone('Etc/GMT+1')
pa.lib.string_to_tzinfo(pa.lib.tzinfo_to_string(tz))
---------------------------------------------------------------------------
UnknownTimeZoneError                      Traceback (most recent call last)
<ipython-input-4-b890180b2fad> in <module>
----> 1 pa.lib.string_to_tzinfo(pa.lib.tzinfo_to_string(tz))

~/Workspace/arrow/python/pyarrow/types.pxi in pyarrow.lib.string_to_tzinfo()
   1838         Time zone object
   1839     """
-> 1840     cdef PyObject* tz = GetResultValue(StringToTzinfo(name.encode('utf-8')))
   1841     return PyObject_to_object(tz)
   1842

~/Workspace/arrow/python/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status()
    120 cdef api int pyarrow_internal_check_status(const CStatus& status) \
    121         nogil except -1:
--> 122     return check_status(status)

~/.conda/envs/arrow38/lib/python3.8/site-packages/pytz/__init__.py in timezone(zone)
    179                 fp.close()
    180         else:
--> 181             raise UnknownTimeZoneError(zone)
    182
    183     return _tzinfo_cache[zone]

UnknownTimeZoneError: '-01'

Reporter: Krisztian Szucs / @kszucs
Assignee: Krisztian Szucs / @kszucs

Related issues:

Note: This issue was originally created as ARROW-9993. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions