@@ -2,7 +2,7 @@ from datetime import datetime
22from typing import List , Sequence , Tuple , TypedDict
33
44from ._attributes import Attributes
5- from ._buffer import Buffer
5+ from ._buffer import Bytes
66from ._list import ObjectMeta
77from .store import ObjectStore
88
@@ -199,7 +199,30 @@ class GetResult:
199199 """
200200
201201class BytesStream :
202- """An async stream of bytes."""
202+ """An async stream of bytes.
203+
204+ !!! note "Request timeouts"
205+ The underlying stream needs to stay alive until the last chunk is polled. If the
206+ file is large, it may exceed the default timeout of 30 seconds. In this case,
207+ you may see an error like:
208+
209+ ```
210+ GenericError: Generic {
211+ store: "HTTP",
212+ source: reqwest::Error {
213+ kind: Decode,
214+ source: reqwest::Error {
215+ kind: Body,
216+ source: TimedOut,
217+ },
218+ },
219+ }
220+ ```
221+
222+ To fix this, set the `timeout` parameter in the `client_options` passed to the
223+ initial `get` or `get_async` call. See
224+ [ClientConfigKey][obstore.store.ClientConfigKey].
225+ """
203226
204227 def __aiter__ (self ) -> BytesStream :
205228 """Return `Self` as an async iterator."""
@@ -235,7 +258,7 @@ async def get_async(
235258 Refer to the documentation for [get][obstore.get].
236259 """
237260
238- def get_range (store : ObjectStore , path : str , start : int , end : int ) -> Buffer :
261+ def get_range (store : ObjectStore , path : str , start : int , end : int ) -> Bytes :
239262 """
240263 Return the bytes that are stored at the specified location in the given byte range.
241264
@@ -251,21 +274,19 @@ def get_range(store: ObjectStore, path: str, start: int, end: int) -> Buffer:
251274 end: The end of the byte range (exclusive).
252275
253276 Returns:
254- A `Buffer ` object implementing the Python buffer protocol, allowing
277+ A `Bytes ` object implementing the Python buffer protocol, allowing
255278 zero-copy access to the underlying memory provided by Rust.
256279 """
257280
258- async def get_range_async (
259- store : ObjectStore , path : str , start : int , end : int
260- ) -> Buffer :
281+ async def get_range_async (store : ObjectStore , path : str , start : int , end : int ) -> Bytes :
261282 """Call `get_range` asynchronously.
262283
263284 Refer to the documentation for [get_range][obstore.get_range].
264285 """
265286
266287def get_ranges (
267288 store : ObjectStore , path : str , starts : Sequence [int ], ends : Sequence [int ]
268- ) -> List [Buffer ]:
289+ ) -> List [Bytes ]:
269290 """
270291 Return the bytes that are stored at the specified location in the given byte ranges
271292
@@ -281,14 +302,14 @@ def get_ranges(
281302 ends: A sequence of `int` where each offset ends (exclusive).
282303
283304 Returns:
284- A sequence of `Buffer `, one for each range. This `Buffer ` object implements the
305+ A sequence of `Bytes `, one for each range. This `Bytes ` object implements the
285306 Python buffer protocol, allowing zero-copy access to the underlying memory
286307 provided by Rust.
287308 """
288309
289310async def get_ranges_async (
290311 store : ObjectStore , path : str , starts : Sequence [int ], ends : Sequence [int ]
291- ) -> List [Buffer ]:
312+ ) -> List [Bytes ]:
292313 """Call `get_ranges` asynchronously.
293314
294315 Refer to the documentation for [get_ranges][obstore.get_ranges].
0 commit comments