dev(narugo): use new cache key (with mtime and size) for local index files#65
dev(narugo): use new cache key (with mtime and size) for local index files#65narugo1992 merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
hfutils/index/local_fetch.py:40
- [nitpick] Consider renaming the reused variable 'idx_file' when extracting it from the cache key tuple in 'tar_get_index' (line 81) to 'resolved_idx_file' to improve code clarity.
idx_file = idx_file or default_index_file
hfutils/index/local_fetch.py:86
- There is a potential issue if the provided index file does not exist; the function returns a cache key with (idx_file, None, None) and then attempts to open the file, which may raise an error. Consider adding a check or error handling prior to opening the file.
with open(idx_file, 'r') as f:
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #65 +/- ##
==========================================
- Coverage 87.12% 87.11% -0.01%
==========================================
Files 60 60
Lines 2050 2057 +7
==========================================
+ Hits 1786 1792 +6
- Misses 264 265 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
hfutils/index/local_fetch.py:36
- Update the example in the docstring to reflect that the function now returns a tuple (file path, mtime, size) instead of just a string.
>>> key = _tar_get_cache_key('archive.tar', 'index.json')
hfutils/index/local_fetch.py:81
- [nitpick] Consider using a more descriptive variable name for the file path extracted from the cache key tuple (e.g., 'normalized_idx_file') rather than reassigning 'idx_file', to improve clarity.
idx_file, _, _ = cache_key
No description provided.