You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Alenka Frim (Jira)" <ji...@apache.org> on 2022/03/29 09:19:00 UTC

[jira] [Created] (ARROW-16056) [Python] `tzinfo_to_string` should accept None

Alenka Frim created ARROW-16056:
-----------------------------------

             Summary: [Python] `tzinfo_to_string` should accept None
                 Key: ARROW-16056
                 URL: https://issues.apache.org/jira/browse/ARROW-16056
             Project: Apache Arrow
          Issue Type: Improvement
          Components: Python
            Reporter: Alenka Frim


Currently {{tzinfo_to_string}} errors with {{Not an instance of datetime.tzinfo}} when timezone is None. 
{code:python}
>>> tz = None
>>> import pyarrow
>>> pyarrow.lib.tzinfo_to_string(None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pyarrow/types.pxi", line 2080, in pyarrow.lib.tzinfo_to_string
    return frombytes(GetResultValue(TzinfoToString(<PyObject*>tz)))
  File "pyarrow/error.pxi", line 143, in pyarrow.lib.pyarrow_internal_check_status
    return check_status(status)
  File "pyarrow/error.pxi", line 122, in pyarrow.lib.check_status
    raise ArrowTypeError(message)
pyarrow.lib.ArrowTypeError: Not an instance of datetime.tzinfo
{code}
{{tzinfo_to_string}} should accept None also. With this {{arrays()}} in python/pyarrow/tests/strategies.py in case of timestamp dtype should also accept None.

See
 * [https://github.com/apache/arrow/pull/12522#discussion_r822637011|https://github.com/apache/arrow/pull/12522#discussion_r837216640]
 * [https://github.com/apache/arrow/pull/12522#discussion_r837216640]



--
This message was sent by Atlassian Jira
(v8.20.1#820001)