Skip to content

Commit a81c172

Browse files
committed
add indexed table test
1 parent f2caeff commit a81c172

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_table.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,3 +784,14 @@ def test_interpolation_search(arr, x):
784784
else:
785785
with pytest.raises(ground_truth):
786786
_interpolation_search(arr, x)
787+
788+
789+
def test_indexed_table_mixin():
790+
n_rows_per_chunk = 10
791+
n_chunks = 4
792+
pa_table = pa.Table.from_pydict({"col": [0] * n_rows_per_chunk})
793+
pa_table = pa.concat_tables([pa_table] * n_chunks)
794+
table = Table(pa_table)
795+
assert all(table._offsets.tolist() == np.cumsum([0] + [n_rows_per_chunk] * n_chunks))
796+
assert table.fast_slice(5) == pa_table.slice(5)
797+
assert table.fast_slice(2, 13) == pa_table.slice(2, 13)

0 commit comments

Comments
 (0)