Fix CI: commit operation equality (hfh 1.20.0) and pytest parametrize collection error#8283
Merged
Merged
Conversation
Two unrelated CI failures: 1. tests/test_hub.py::test_delete_from_hub Since huggingface_hub 1.20.0 (huggingface/huggingface_hub#4331), `UploadInfo` is no longer a dataclass and `CommitOperationAdd`/`CommitOperationDelete` no longer implement value equality. Two operations with identical content are therefore not equal anymore, breaking the `operations == expected_operations` assertion. Compare operations attribute by attribute instead. This is a breaking change in huggingface_hub that will not be reverted upstream. 2. tests/test_load.py collection error A trailing comma in `@pytest.mark.parametrize("stream_from_cache, ", ...)` made recent pytest parse it as two argnames, raising `TypeError: object of type 'bool' has no len()` at collection time. Drop the trailing comma. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two unrelated CI failures (seen e.g. in the
huggingface_hub1.21.0.rc0 test run, but the first one already affectsmainwith the latest stablehuggingface_hub).1.
tests/test_hub.py::test_delete_from_hubSince
huggingface_hub1.20.0 (introduced in huggingface/huggingface_hub#4331),UploadInfois no longer a dataclass and thereforeCommitOperationAdd/CommitOperationDeleteno longer implement value equality. Two commit operations with identical content are no longer considered equal, which broke:with an
AssertionErrorbetween two byte-identicalCommitOperationAddobjects.Updated the test to compare operations attribute by attribute (type,
path_in_repo,is_folder,path_or_fileobj) instead of relying on==.2.
tests/test_load.pycollection errorA trailing comma in
@pytest.mark.parametrize("stream_from_cache, ", [False, True])made recentpytestversions parse it as two argnames and expect each parameter value to be a 2-tuple, failing at collection time (which errors out the wholetest_load.pymodule). This is unrelated tohuggingface_hub. Fixed by dropping the trailing comma.🤖 Generated with Claude Code