Repository navigation
Add a store_time flag to get and tag filtering to iterkeys - #16
Merged
Merged
Conversation
…at appends the store time to the returned tuple
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.
Two additive features requested upstream.
store_timeonget(upstream issue 330):Cache.get,FanoutCache.getandDjangoCache.gettakestore_time=Falseas their last parameter. When true, the store time is appended after the value and any other requested metadata, in the order expire time, tag, store time, so every existing tuple shape is unchanged when the flag is off; misses andFanoutCacheshard timeouts returnNonefor each requested field. One helper builds the tuple for hits, misses and timeouts; thegetquery selects one more column.pophas its own flags and is untouched.iterkeys(tag=...)(upstream issue 341): upstream pull request 372 merged with its original commit.tagdefaults to theENOVALsentinel meaning no filter;tag=Noneselects untagged rows; the filter runs inside the existing key pagination, keepsreversesemantics and fetches no values. It brought parametrized tests and a tutorial section with doctests.FanoutCachehas noiterkeys, so nothing to pass through.Tests: all tuple shapes on the three classes including misses and the
FanoutCachetimeout path, a file-like value, and the Django variant; the tutorial gains astore_timeparagraph with a doctest.Verified locally: 384 tests pass at 98.85 % on Python 3.12 with Django 4.2 and on 3.14 with Django 6.0, golden fixtures included; bluecheck, isortcheck, flake8, mypy, pylint, doc8, rstcheck and the Sphinx build pass.