Skip to content

Commit

Permalink
ARROW-16442: [Python][Dataset] Fix fragments of ORC Dataset to use Fi…
Browse files Browse the repository at this point in the history
…leFragment class

Closes #13052 from jorisvandenbossche/ARROW-16442

Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
  • Loading branch information
jorisvandenbossche authored and kszucs committed May 3, 2022
1 parent 3cf4343 commit cf2a35c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/pyarrow/_dataset.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,7 @@ cdef class Fragment(_Weakrefable):
# corresponding subclasses of FileFragment
'ipc': FileFragment,
'csv': FileFragment,
'orc': FileFragment,
'parquet': _get_parquet_symbol('ParquetFileFragment'),
}

Expand Down
2 changes: 2 additions & 0 deletions python/pyarrow/tests/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2880,6 +2880,8 @@ def test_orc_format(tempdir, dataset_reader):
orc.write_table(table, path)

dataset = ds.dataset(path, format=ds.OrcFileFormat())
fragments = list(dataset.get_fragments())
assert isinstance(fragments[0], ds.FileFragment)
result = dataset_reader.to_table(dataset)
result.validate(full=True)
assert result.equals(table)
Expand Down

0 comments on commit cf2a35c

Please sign in to comment.