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

[C++] Unable to read date64 or date32 in specific format from CSV

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0
    • None
    • C++, Python

    Description

      when importing csv data with dates in the format "%d-%b-%y" or "%d-%b-%Y" an error is given in conversion:

      example:

      import pyarrow as pa
      from pyarrow import csv 
      
      data = b"a,b\n1,15-OCT-15\n2,18-JUN-90\n"
      tp = ["%d-%b-%y"]
      
      try:
          schema_d64 = pa.schema([pa.field("a", pa.int64()), pa.field("b", pa.date64())])
          co_d64 = csv.ConvertOptions(timestamp_parsers=tp, column_types=schema_d64)
          a_d64 = csv.read_csv(pa.py_buffer(data), convert_options=co_d64)
      except Exception as e:
          print(e)
      try:
          schema_d32 = pa.schema([pa.field("a", pa.int64()), pa.field("b", pa.date32())])
          co_d32 = csv.ConvertOptions(timestamp_parsers=tp, column_types=schema_d32)
          a_d32 = csv.read_csv(pa.py_buffer(data), convert_options=co_d32)
      except Exception as e:
          print(e)

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sbias-moj Stephen Bias
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: