# Custom FileBasedDatasource requires dataset\_uuid

**URL:** <https://discuss.ray.io/t/custom-filebaseddatasource-requires-dataset-uuid/10761>\
**Category:** Ray Data\
**Created:** [May 23, 2023, 6:43pm UTC](https://discuss.ray.io/t/custom-filebaseddatasource-requires-dataset-uuid/10761 "2023-05-23T18:43:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![faissal](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/faissal/32/4471_2.png) [@faissal](https://discuss.ray.io/u/faissal)\
**Post date:** [May 23, 2023, 6:43pm UTC](https://discuss.ray.io/t/custom-filebaseddatasource-requires-dataset-uuid/10761/1 "2023-05-23T18:43:55Z")

</div>

**How severe does this issue affect your experience of using Ray?**

- Low: It annoys or frustrates me for a moment.

I’d like to inherit ParquetDatasource / FileBasedDatasource in a custom Datasource.  
But FileBaseDatasource write() API requires dataset\_uuid.

I get:  
TypeError: FileBasedDatasource.write() missing 1 required positional argument: ‘dataset\_uuid’

There isn’t a good way to call dataset.write\_datasource(MyCustomDatasource(), …)  
Since I need to access dataset.\_uuid which is intended to be private.

I can work around it by writing two lines:  
dataset\_uuid = dataset.\_uuid # hack  
dataset.write\_datasource(MyCustomDatasource(), …, dataset\_uuid=dataset\_uuid)

But its annoying to require all my users to do this in their flows:  
dataset.map(…).map(…).write\_datasource(MyCustomDatasource(), …, )

Any recommendations? I think write\_datasource should pass dataset\_uuid as a kwarg for all calls. Or provide a context/accessor to the Datasource constructor. Maybe I am missing something?
