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

Regression: Cannot round-trip IPC files between PyArrow and Arrow JS

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 0.15.0, 0.15.1
    • Fix Version/s: None
    • Component/s: JavaScript, Python
    • Labels:
      None
    • Environment:

      Description

      Originally raised by Sarath on StackOverflow, reporting here as I've run into this issue as well.

      When exporting an Arrow table using PyArrow, ArrowJS incorrectly imports it as a 0-row table, skipping any data in the table. The schema is imported correctly, including metadata, but the length of the table is 0.

      import pyarrow as pa
      table = pa.Table.from_pydict( {"a": [1, 2, 3], "b": [4, 5, 6]} )
      
      with pa.RecordBatchFileWriter('file.arrow', table.schema) as writer:
          writer.write_table(table)
      

      If file.arrow was generated with PyArrow 0.15, the following JS snippet will fail. However, if you generated it with PyArrow 0.14, then the JS snippet will work as expected:

      const { readFileSync } = require("fs");
      const { Table } = require("apache-arrow");
      
      const data = readFileSync("file.arrow");
      const table = Table.from([ data ]);
      
      console.assert(table.length === 3, "Table should have 3 rows");
      console.assert(table.get(0) != null, "First row should not be null");
      

      Tested with PyArrow 0.14.1, 0.15.0, and ArrowJS 0.13.0 and 0.14.1.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              quigleyj Joe Quigley
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: