Asynchronously open a file and return an async context manager.
This function checks if the underlying filesystem supports obstore bypass.
If it does, it uses obstore to open the file. Otherwise, it falls back to
the standard _open function which uses AsyncFileSystem.
It will raise NotImplementedError if neither obstore nor AsyncFileSystem is supported.
Put a stream of data to a remote location. This is useful for streaming data to a remote location.
Example usage:
import flyte.storage as storage
storage.put_stream(iter([b'hello']), name="my_file.txt")
OR
storage.put_stream(iter([b'hello']), to_path="s3://my_bucket/my_file.txt")
Parameter
Type
Description
data_iterable
typing.AsyncIterable[bytes] | bytes
Iterable of bytes to be streamed.
name
str | None
Name of the file to be created. If not provided, a random name will be generated.
to_path
str | None
Path to the remote location where the data will be stored.
kwargs
**kwargs
Additional arguments to be passed to the underlying filesystem. :rtype: str :return: The path to the remote location where the data was stored.