What’s the migration path for ray.data.datasource.tfrecords_datasource.TFRecordDatasource?

I was using from ray.data.datasource.tfrecords_datasource import TFRecordDatasource in ray 2.23.0. But after upgrading to 2.40.0, this class was moved to ray.data._internal.datasource.tfrecords_datasource.TFRecordDatasource from this change.

similar to What's the migration path for ray.data.aggregate's Max, Mean, Min, and Std functions?

@davidxia could you share your use case/why you need to import that? TFRecordDatasource, like our other data sources, is supposed to be a private implementation.

We recommend just maintaining a separate version, or figuring out how we can support your changes to TFRecordDatasource if you’ve made extensions.

We were using when it was public but alpha in 2.23.0. It was privatized here. We’ve since stopped using the class directly. I think we were using it before it had the tfx-bsl performance improvement.

Now we use ray.data.read_tfrecords(tfx_read_options=...). Using the tfx_read_options parameter which will read TFRecords with tfx-bsl which is faster.

1 Like