Skip to content

Correct hf jobs/spaces --timeout help: durations are int, not int/float - #4477

Merged
Wauplin merged 1 commit into
huggingface:mainfrom
Sreekant13:feat/parse-size-duration-accept-floats
Jul 3, 2026
Merged

Wauplin merged 1 commit into
huggingface:mainfrom
Sreekant13:feat/parse-size-duration-accept-floats

Conversation

@Sreekant13

@Sreekant13 Sreekant13 commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Following the review, instead of adding float support this just corrects the misleading help.

The --timeout option on hf jobs run / hf jobs wait / hf spaces wait (and the matching HfApi.run_job timeout docstrings) advertised int/float with s/m/h/d, but the string-with-unit form only accepts integers, so --timeout 1.5h raised ValueError. This drops float from the help so the advertised format matches what's accepted. Users can write 90m instead of 1.5h. Regenerated the CLI reference doc (package_reference/cli.md) to match.

Addresses #4476.

@Wauplin

Wauplin commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks for noticing! Preferable to just update the help text yes. User can do "90m" instead of "1.5h" to avoid decimal values.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 8267b71. Configure here.

Comment thread src/huggingface_hub/utils/_parsing.py Resolved
Sreekant13 added a commit to Sreekant13/huggingface_hub that referenced this pull request Jul 3, 2026
Following review on huggingface#4477: instead of adding float support, correct the
advertised help. The --timeout options of `hf jobs` / `hf spaces` (and the
HfApi.run_job timeout docstrings) said "int/float with s/m/h/d", but the
string form only accepts integers (e.g. use "90m" instead of "1.5h"). Drop
the misleading "float" and regenerate the CLI reference doc to match.
@Sreekant13
Sreekant13 force-pushed the feat/parse-size-duration-accept-floats branch from 8267b71 to 2d90b2c Compare July 3, 2026 09:38
Following review on huggingface#4477: instead of adding float support, correct the
advertised help. The --timeout options of `hf jobs` / `hf spaces` (and the
HfApi.run_job timeout docstrings) said "int/float with s/m/h/d", but the
string form only accepts integers (e.g. use "90m" instead of "1.5h"). Drop
the misleading "float" and regenerate the CLI reference doc to match.
@Sreekant13
Sreekant13 force-pushed the feat/parse-size-duration-accept-floats branch from 2d90b2c to c9d7d19 Compare July 3, 2026 09:42

@Wauplin Wauplin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

@Wauplin

Wauplin commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

@Sreekant13 can you update the PR title and description accordingly now? other than that we should be good to merge once CI is green 🤗

@Sreekant13

Copy link
Copy Markdown
Contributor Author

Thank you so much @Wauplin! Switched to just fixing the help text as you suggested and dropped "float" from the --timeout help on jobs/spaces, updated the matching HfApi.run_job docstrings, and regenerated the CLI reference doc. "90m" it is 🙂

Will update the Title and Description now as well.

@Sreekant13 Sreekant13 changed the title Accept float values in parse_size and parse_duration Correct hf jobs/spaces --timeout help: durations are int, not int/float Jul 3, 2026
@Wauplin
Wauplin merged commit fe51334 into huggingface:main Jul 3, 2026
19 of 22 checks passed
@Wauplin

Wauplin commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Great, merged it!

@bot-ci-comment

bot-ci-comment Bot commented Jul 3, 2026

Copy link
Copy Markdown

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.

@Sreekant13
Sreekant13 deleted the feat/parse-size-duration-accept-floats branch July 3, 2026 09:49
@Sreekant13

Copy link
Copy Markdown
Contributor Author

Thanks a lot, @Wauplin!

@codecov

codecov Bot commented Jul 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.92%. Comparing base (1daa48b) to head (c9d7d19).
⚠️ Report is 497 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4477      +/-   ##
==========================================
+ Coverage   75.00%   75.92%   +0.92%     
==========================================
  Files         145      177      +32     
  Lines       13978    22917    +8939     
==========================================
+ Hits        10484    17400    +6916     
- Misses       3494     5517    +2023     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@huggingface-hub-bot

Copy link
Copy Markdown
Contributor

This PR has been shipped as part of the v1.23.0 release.

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