Skip to content

dev(narugo): add write_bytes functions to hfutils.index system #66

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

narugo1992
Copy link
Contributor

No description provided.

@narugo1992 narugo1992 added the enhancement New feature or request label Apr 4, 2025
@narugo1992 narugo1992 self-assigned this Apr 4, 2025
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 97.54601% with 4 lines in your changes missing coverage. Please review.

Project coverage is 87.78%. Comparing base (2aea1db) to head (5dec5db).

Files with missing lines Patch % Lines
hfutils/index/fetch.py 95.45% 2 Missing ⚠️
hfutils/index/local_fetch.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   87.11%   87.78%   +0.66%     
==========================================
  Files          60       61       +1     
  Lines        2057     2202     +145     
==========================================
+ Hits         1792     1933     +141     
- Misses        265      269       +4     
Flag Coverage Δ
unittests 87.78% <97.54%> (+0.66%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

@narugo1992 narugo1992 requested a review from Copilot April 4, 2025 18:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

Files not reviewed (1)
  • docs/source/api_doc/index/local_fetch.rst: Language not supported
Comments suppressed due to low confidence (1)

hfutils/index/local_fetch.py:319

  • [nitpick] The parameter name 'file' shadows a Python built-in. Consider renaming it to 'file_obj' to avoid potential confusion.
def tar_file_write_bytes(archive_file: str, file_in_archive: str, file: BinaryIO,

@narugo1992 narugo1992 requested a review from Copilot April 5, 2025 05:39
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • docs/source/api_doc/index/local_fetch.rst: Language not supported
Comments suppressed due to low confidence (1)

hfutils/index/local_fetch.py:424

  • Setting no_validate to True in the tar_file_download function bypasses size/hash verification, which is inconsistent with the behavior in tar_file_write_bytes. Please confirm that this design choice is intentional to avoid potential integrity issues.
no_validate=True,

@narugo1992
Copy link
Contributor Author

now waiting for huggingface/huggingface_hub#2978 and huggingface/huggingface_hub#2979

after hf_transfer explicit option is on, we can go into next step

create a binaryio class which only implement then write and tell function, so that we can proxy the binary writing and validate its binary sha256

@narugo1992 narugo1992 requested a review from Copilot April 7, 2025 12:06
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 8 out of 12 changed files in this pull request and generated no comments.

Files not reviewed (4)
  • docs/source/api_doc/index/fetch.rst: Language not supported
  • docs/source/api_doc/index/local_fetch.rst: Language not supported
  • docs/source/api_doc/utils/binary_proxy.rst: Language not supported
  • docs/source/api_doc/utils/index.rst: Language not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant