Fix a logic for invalidating the cache in CachedStorage#4670
Merged
not522 merged 1 commit intooptuna:masterfrom May 22, 2023
Merged
Fix a logic for invalidating the cache in CachedStorage#4670not522 merged 1 commit intooptuna:masterfrom
CachedStorage#4670not522 merged 1 commit intooptuna:masterfrom
Conversation
delete_study method in CachedStorage
Codecov Report
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. @@ Coverage Diff @@
## master #4670 +/- ##
==========================================
+ Coverage 90.62% 90.63% +0.01%
==========================================
Files 187 187
Lines 14297 14299 +2
==========================================
+ Hits 12956 12960 +4
+ Misses 1341 1339 -2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
delete_study method in CachedStorageCachedStorage
5680898 to
04471b2
Compare
c-bata
commented
May 12, 2023
| def delete_study(self, study_id: int) -> None: | ||
| with self._lock: | ||
| if study_id in self._studies: | ||
| for trial_id in self._studies[study_id].trials: |
Member
Author
There was a problem hiding this comment.
The key of self._studies is not a trial_id. It's a trial number.
Member
|
@gen740 Could you review this PR? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
While reviewing #4631, I found a bug in CachedStorage's delete_study method.
I will make this PR ready for review after #4631 is merged.
Description of the changes
Added a test case and fixed a logic for invalidating the cache. See 5680898 for details.