2022-05-17 16:23:42 -07:00
|
|
|
.. _datasets_custom_datasource:
|
|
|
|
|
2022-01-27 22:14:36 +01:00
|
|
|
------------------------
|
|
|
|
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)
|