Skip to content

fix: hf.revision property to pin HuggingFace Hub reads#3609

Draft
kszucs wants to merge 1 commit into
apache:mainfrom
kszucs:feat/hf-revision-property
Draft

fix: hf.revision property to pin HuggingFace Hub reads#3609
kszucs wants to merge 1 commit into
apache:mainfrom
kszucs:feat/hf-revision-property

Conversation

@kszucs

@kszucs kszucs commented Jul 6, 2026

Copy link
Copy Markdown
Member

Rationale for this change

HuggingFace Hub (hf://) storage support already works via fsspec's HfFileSystem, but has no way to pin reads to a specific revision (branch/tag/commit) for reproducibility, unlike iceberg-rust's HF_REVISION. HfFileSystem resolves revision per call rather than as a filesystem-wide default, so hf.revision is threaded through as a read-time kwarg on FsspecInputFile. Writes and deletes intentionally always target the repository's default branch, since a pinned revision can be an immutable tag or commit and isn't a valid write target.

Are these changes tested?

Yes: unit tests covering revision forwarding on reads (len(), .exists(), .open()), confirming writes don't receive the revision kwarg, the no-revision-set default, and non-hf schemes being unaffected.

Are there any user-facing changes?

Yes: new hf.revision table/catalog property, documented in configuration.md.

huggingface_hub.HfFileSystem resolves revision per call rather than as
a filesystem-wide default, so hf.revision is threaded through as a
read-time kwarg on FsspecInputFile. Writes and deletes always target
the repository's default branch, since a pinned revision can be an
immutable tag or commit.
@kszucs kszucs changed the title Add hf.revision property to pin HuggingFace Hub reads fix: hf.revision property to pin HuggingFace Hub reads Jul 6, 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.

1 participant