Skip to content

feat(data): add optional source_range to download_stream#724

Closed
kszucs wants to merge 2 commits into
huggingface:mainfrom
kszucs:download-stream-range
Closed

feat(data): add optional source_range to download_stream#724
kszucs wants to merge 2 commits into
huggingface:mainfrom
kszucs:download-stream-range

Conversation

@kszucs
Copy link
Copy Markdown
Member

@kszucs kszucs commented Mar 17, 2026

Summary

  • Adds an optional source_range: Option<Range<u64>> parameter to FileDownloadSession::download_stream
  • When None, behaviour is unchanged (full file streaming)
  • When Some(range), the stream is reconstructed for the given byte range only
  • Updates test_utils.rs to pass None at the existing call site

Motivation

Required by the Apache OpenDAL HuggingFace backend (apache/opendal#7185) to support efficient range reads (e.g. reading Parquet footers) over the XET CAS protocol without downloading the full file.

@kszucs
Copy link
Copy Markdown
Member Author

kszucs commented Mar 17, 2026

@hoytak please review

@hoytak
Copy link
Copy Markdown
Collaborator

hoytak commented Mar 18, 2026

Nice! The API is getting moved to the xet session interface, but I made sure the new stream api had this. See #729.

@hoytak
Copy link
Copy Markdown
Collaborator

hoytak commented Mar 19, 2026

Implemented with testing and unified interface as part of #735

@kszucs
Copy link
Copy Markdown
Member Author

kszucs commented Mar 25, 2026

Great, thanks!

Closing in favor of #735

@kszucs kszucs closed this Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants