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

[Python] Pass **kwargs in read_feather to to_pandas()

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 11.0.0
    • Python
    • Any environment

    Description

      A feather file with a column containing dates lower than 1677 or greater than 2262 cannot be read with pandas, du to  `.to_pandas` method.

      To reproduce the issue:

      ### create feather file
      import pandas as pd
      from datetime import datetime
      df = pd.DataFrame({"date": [
      datetime.fromisoformat("1654-01-01"),
      datetime.fromisoformat("1920-01-01"),
      ],})
      df.to_feather("to_trash.feather")
      
      ### read feather file      
      from pyarrow.feather import read_feather
      read_feather("to_trash.feather")
      

       

      I think that the expected behavior would be to have an object column contining datetime objects.

      I think that the problem comes from _array_like_to_pandas method :
      https://github.com/apache/arrow/blob/76f45a6892b13391fdede4c72934f75f6d56143c/python/pyarrow/array.pxi#L1584

      or  from `_to_pandas()`
      https://github.com/apache/arrow/blob/76f45a6892b13391fdede4c72934f75f6d56143c/python/pyarrow/array.pxi#L2742

      or from `to_pandas`:
      https://github.com/apache/arrow/blob/76f45a6892b13391fdede4c72934f75f6d56143c/python/pyarrow/array.pxi#L673

      Attachments

        Issue Links

          Activity

            People

              alenka Alenka Frim
              adrienpacifico Adrien Pacifico
              Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 1h 50m
                  1h 50m