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

[PYTHON] serialize_pandas on empty dataframe

    XMLWordPrintableJSON

Details

    Description

      This code

      import pandas as pd
      import pyarrow as pa
      
      pa.serialize_pandas(pd.DataFrame())
      

      Raises

      ---------------------------------------------------------------------------
      ArrowNotImplementedError                  Traceback (most recent call last)
      <ipython-input-71-ad21add45f0d> in <module>()
      ----> 1 pa.serialize_pandas(pd.DataFrame())
      
      ~/Envs/dask-dev/lib/python3.6/site-packages/pyarrow/ipc.py in serialize_pandas(df)
          158     sink = pa.BufferOutputStream()
          159     writer = pa.RecordBatchStreamWriter(sink, batch.schema)
      --> 160     writer.write_batch(batch)
          161     writer.close()
          162     return sink.get_result()
      
      pyarrow/ipc.pxi in pyarrow.lib._RecordBatchWriter.write_batch (/Users/travis/build/apache/arrow-dist/arrow/python/build/temp.macosx-10.6-intel-3.6/lib.cxx:59238)()
      
      pyarrow/error.pxi in pyarrow.lib.check_status (/Users/travis/build/apache/arrow-dist/arrow/python/build/temp.macosx-10.6-intel-3.6/lib.cxx:8113)()
      
      ArrowNotImplementedError: Unable to convert type: null
      
      

      Presumably pa.deserialize_pandas will need a fix as well.

      Attachments

        Activity

          People

            wesm Wes McKinney
            TomAugspurger Tom Augspurger
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: