ray.data.expressions.download#

ray.data.expressions.download(uri_column_name: str) DownloadExpr[source]#

Create a download expression that downloads content from URIs.

This creates an expression that will download bytes from URIs stored in a specified column. When evaluated, it will fetch the content from each URI and return the downloaded bytes.

Parameters:

uri_column_name – The name of the column containing URIs to download from

Returns:

A DownloadExpr that will download content from the specified URI column

Example

>>> from ray.data.expressions import download
>>> import ray
>>> # Create dataset with URIs
>>> ds = ray.data.from_items([
...     {"uri": "s3://bucket/file1.jpg", "id": "1"},
...     {"uri": "s3://bucket/file2.jpg", "id": "2"}
... ])
>>> # Add downloaded bytes column
>>> ds_with_bytes = ds.with_column("bytes", download("uri"))

DeveloperAPI: This API may change across minor Ray releases.