Skip to content

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

Merged
narugo1992 merged 16 commits intomainfrom
dev/write
May 2, 2025
Merged

dev(narugo): add write_bytes functions to hfutils.index system#66
narugo1992 merged 16 commits intomainfrom
dev/write

Conversation

@narugo1992
Copy link
Copy Markdown
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
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 97.09302% with 5 lines in your changes missing coverage. Please review.

Project coverage is 87.84%. Comparing base (3ae5625) to head (c2612e3).
Report is 17 commits behind head on main.

Files with missing lines Patch % Lines
hfutils/index/fetch.py 94.33% 3 Missing ⚠️
hfutils/index/local_fetch.py 93.75% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   87.20%   87.84%   +0.63%     
==========================================
  Files          63       64       +1     
  Lines        2150     2304     +154     
==========================================
+ Hits         1875     2024     +149     
- Misses        275      280       +5     
Flag Coverage Δ
unittests 87.84% <97.09%> (+0.63%) ⬆️

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
Copy Markdown
Contributor

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 and others added 2 commits April 5, 2025 02:34
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@narugo1992 narugo1992 requested a review from Copilot April 5, 2025 05:39
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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

@narugo1992 narugo1992 merged commit edad3c7 into main May 2, 2025
28 checks passed
@narugo1992 narugo1992 deleted the dev/write branch May 2, 2025 20:55
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.

2 participants