You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Python] pyarrow.dataset.dataset does not accept RecordBatchReader as source #38012
Describe the bug, including details regarding any error messages, version, and platform.
The documentation of pyarrow.dataset.dataset says this function accepts RecordBatchReader as source.
(List of) batches or tables, iterable of batches, or RecordBatchReader:
Create an InMemoryDataset. If an iterable or empty list is given, a schema must also be given. If an iterable or RecordBatchReader is given, the resulting dataset can only be scanned once; further attempts will raise an error. https://arrow.apache.org/docs/python/generated/pyarrow.dataset.dataset.html#pyarrow-dataset-dataset
However, pyarrow.dataset.dataset throws TypeError when we call this function with RecordBatchReader as source.
File /opt/conda/lib/python3.9/site-packages/pyarrow/dataset.py:793, in dataset(source, schema, format, filesystem, partitioning, partition_base_dir, exclude_invalid_files, ignore_prefixes)
791 return _in_memory_dataset(source, **kwargs)
792 else:
--> 793 raise TypeError(
794 'Expected a path-like, list of path-likes or a list of Datasets '
795 'instead of the given type: {}'.format(type(source).__name__)
796 )
TypeError: Expected a path-like, list of path-likes or a list of Datasets instead of the given type: RecordBatchReader
changed the title [-]pyarrow.dataset.dataset does not accept RecordBatchReader as source[/-][+][Python] pyarrow.dataset.dataset does not accept RecordBatchReader as source[/+]on Oct 4, 2023
Activity
mapleFU commentedon Oct 4, 2023
Seems from code it should be record-batch or table, maybe first add a casting as a workaround?
[-]pyarrow.dataset.dataset does not accept RecordBatchReader as source[/-][+][Python] pyarrow.dataset.dataset does not accept RecordBatchReader as source[/+]kou commentedon Oct 4, 2023
@lidavidm It seems that this is related to #10070 / #28047.
Should we update the document?
lidavidm commentedon Oct 4, 2023
Yes, we should update the docs
kou commentedon Oct 4, 2023
OK.
@sugibuchi Do you want to work on this?
thisisnic commentedon Sep 26, 2026
Can no longer reproduce, closing