Repository navigation
feat(python): type and document explicit cache key selectors - #214
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #214 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 78 78
Lines 11351 11357 +6
Branches 657 656 -1
=======================================
+ Hits 10640 10646 +6
Misses 641 641
Partials 70 70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Python's docs currently lead with inferred
id_argkeys even thoughcache_keyalready supports TypeScript-style explicit{id, args}selection. Make that existing selector the primary documented style and exportCacheKeySpec/KeyScalarfor typed selectors. Preserve decorated functions' parameter and result types for synchronous, asynchronous, and custom-awaitable loaders, including use withasyncio.create_task.Keep
id_arg, adapters, and ignored arguments supported. Explicit selectors still receive the original positional and keyword arguments; loader defaults are deliberately not injected because that could break callbacks or change existing keys. Document matching selector defaults and methodself, and cover these conventions with runtime and consumer type-check regressions. Cache execution and Redis wire behavior are unchanged.Validation:
make check-python: 2,228 passed, including focused mypy consumer checks and committed conformance smoke histories.make integration-python: 343 passed against Redis and 343 against Valkey, including Cluster, invalidation vectors, and the changed Redis documentation example.make docsandmake audit: passed.— Levicus 🤖