Skip to content
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

DM-46936: Fix cache exception when unexpected files present #1134

Merged
merged 1 commit into from
Dec 17, 2024

Conversation

dhirving
Copy link
Contributor

@dhirving dhirving commented Dec 14, 2024

Fix a bug where DatastoreCacheManager would raise ValueError('badly formed hexadecimal UUID string') if files with unexpected names are present in the cache directory when trying to load a file from the cache.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes
  • (if changing dimensions.yaml) make a copy of dimensions.yaml in configs/old_dimensions

Fix a bug where DatastoreCacheManager would raise  ValueError('badly formed hexadecimal UUID string') if files with unexpected names are present in the cache directory when trying to load a file from the cache.
Copy link

codecov bot commented Dec 14, 2024

Codecov Report

Attention: Patch coverage is 95.00000% with 1 line in your changes missing coverage. Please review.

Project coverage is 89.50%. Comparing base (812ef82) to head (d9e1d34).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
python/lsst/daf/butler/datastore/cache_manager.py 90.90% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1134   +/-   ##
=======================================
  Coverage   89.49%   89.50%           
=======================================
  Files         366      366           
  Lines       48832    48848   +16     
  Branches     5906     5907    +1     
=======================================
+ Hits        43703    43720   +17     
+ Misses       3720     3719    -1     
  Partials     1409     1409           

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

@dhirving
Copy link
Contributor Author

Failing Docker build is unrelated and will be fixed later this week.

Copy link
Contributor

@andy-slac andy-slac left a comment

Choose a reason for hiding this comment

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

Looks great.

Comment on lines +1207 to +1210
class InvalidCacheFilenameError(Exception):
"""Raised when attempting to register a file in the cache with a name in
the incorrect format.
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe move it to the top, took me a minute to figure out where the name came from when I read the code above?

@dhirving dhirving merged commit 41225eb into main Dec 17, 2024
18 of 19 checks passed
@dhirving dhirving deleted the tickets/DM-46936 branch December 17, 2024 00:00
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