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

[C++][Python] Restore non-UTC time zones when reading Parquet file that was previously Arrow

    XMLWordPrintableJSON

Details

    Description

      This was reported on the mailing list

      In [20]: df = pd.DataFrame({'a': pd.Series(np.arange(0, 10000, 1000)).astype(pd.DatetimeTZDtype('ns', 'America/Los_Angeles'
          ...: ))})                                                                                                              
      
      In [21]: t = pa.table(df)                                                                                                  
      
      In [22]: t                                                                                                                 
      Out[22]: 
      pyarrow.Table
      a: timestamp[ns, tz=America/Los_Angeles]
      
      In [23]: pq.write_table(t, 'test.parquet')                                                                                 
      
      In [24]: pq.read_table('test.parquet')                                                                                     
      Out[24]: 
      pyarrow.Table
      a: timestamp[us, tz=UTC]
      
      In [25]: pq.read_table('test.parquet')[0]                                                                                  
      Out[25]: 
      <pyarrow.lib.ChunkedArray object at 0x7f72eb4b68f0>
      [
        [
          1970-01-01 00:00:00.000000,
          1970-01-01 00:00:00.000001,
          1970-01-01 00:00:00.000002,
          1970-01-01 00:00:00.000003,
          1970-01-01 00:00:00.000004,
          1970-01-01 00:00:00.000005,
          1970-01-01 00:00:00.000006,
          1970-01-01 00:00:00.000007,
          1970-01-01 00:00:00.000008,
          1970-01-01 00:00:00.000009
        ]
      ]
      

      Attachments

        Issue Links

          Activity

            People

              jorisvandenbossche Joris Van den Bossche
              wesm Wes McKinney
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 0.5h
                  0.5h