Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-5248

[Python] support dateutil timezones

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Python
    • Labels:

      Description

      The dateutil packages also provides a set of timezone objects (https://dateutil.readthedocs.io/en/stable/tz.html) in addition to pytz. In pyarrow, we only support pytz timezones (and the stdlib datetime.timezone fixed offset):

      In [2]: import dateutil.tz                                                                                                                                    
      
      In [3]: import pyarrow as pa                                                                                                                                  
      
      In [5]: pa.timestamp('us', dateutil.tz.gettz('Europe/Brussels'))                                                                                              
      ...
      ~/miniconda3/envs/dev37/lib/python3.7/site-packages/pyarrow/types.pxi in pyarrow.lib.tzinfo_to_string()
      
      ValueError: Unable to convert timezone `tzfile('/usr/share/zoneinfo/Europe/Brussels')` to string
      

      But pandas also supports dateutil timezones. As a consequence, when having a pandas DataFrame that uses a dateutil timezone, you get an error when converting to an arrow table.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                jorisvandenbossche Joris Van den Bossche
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: