ray.data.Dataset.take_all#

Dataset.take_all(limit: int | None = None) List[Dict[str, Any]][source]#

Return all of the rows in this Dataset.

This method is useful for inspecting small datasets.

Warning

take_all() moves the entire dataset to the caller’s machine. If the dataset is large, this method can cause an OutOfMemory error on the caller.

Note

This operation will trigger execution of the lazy transformations performed on this dataset.

Examples

>>> import ray
>>> ds = ray.data.range(5)
>>> ds.take_all()
[{'id': 0}, {'id': 1}, {'id': 2}, {'id': 3}, {'id': 4}]

Time complexity: O(dataset size)

Parameters:

limit – Raise an error if the size exceeds the specified limit.

Returns:

A list of all the rows in the dataset.

See also

take()

Call this method to return a specific number of rows.