mirror of
https://github.com/vale981/ray
synced 2025-03-08 19:41:38 -05:00
15 lines
534 B
ReStructuredText
15 lines
534 B
ReStructuredText
![]() |
------------------------
|
||
|
Using Custom Datasources
|
||
|
------------------------
|
||
|
|
||
|
Datasets can read and write in parallel to `custom datasources <package-ref.html#custom-datasource-api>`__ defined in Python.
|
||
|
Once you have implemented `YourCustomDataSource`, you can use it like any other source in Ray Data:
|
||
|
|
||
|
.. code-block:: python
|
||
|
|
||
|
# Read from a custom datasource.
|
||
|
ds = ray.data.read_datasource(YourCustomDatasource(), **read_args)
|
||
|
|
||
|
# Write to a custom datasource.
|
||
|
ds.write_datasource(YourCustomDatasource(), **write_args)
|