A. Coady created ARROW-15412:
--------------------------------

             Summary: [C++][Python] Slicing a table with no columns returns a 
table with incorrect length.
                 Key: ARROW-15412
                 URL: https://issues.apache.org/jira/browse/ARROW-15412
             Project: Apache Arrow
          Issue Type: Bug
          Components: C++, Python
    Affects Versions: 6.0.1
            Reporter: A. Coady


Python `[:]` slicing works on tables with no columns, because the slice inputs 
are normalized. But the `slice` method is inconsistent.
{code:python}
In [1]: import pyarrow as pa

In [2]: table = pa.table({'col': range(3)})

In [3]: table.slice(1).num_rows
Out[3]: 2

In [4]: table.select([])[1:].num_rows
Out[4]: 2

In [5]: table.select([]).slice(1).num_rows
Out[5]: 3

In [6]: table.select([]).slice(1, 4).num_rows
Out[6]: 4
{code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to