Repository navigation
Conversation
…recation warning The new Cache* names were TypeAliases over the deprecated Redis* classes, so instantiating CachePersistenceLayer raised the deprecation warning meant for RedisCachePersistenceLayer. Move the implementation into cache.py under the Cache* names and keep redis.py as thin @deprecated subclasses, so only the old Redis* names warn. Fixes #8574
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template at |
|
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.



Summary
Fixes #8574.
CachePersistenceLayer,CacheConnectionandCacheClientProtocolwereTypeAliases over the deprecatedRedis*classes. Because they resolve to the same object, instantiatingCachePersistenceLayer(client=...)raised theDeprecationWarningintended forRedisCachePersistenceLayer.This moves the implementation into
cache.pyunder theCache*names and keepsredis.pyas thin@deprecatedsubclasses, so only the oldRedis*names warn.Changes
cache.py: the implementation now lives here underCacheClientProtocol,CacheConnectionandCachePersistenceLayer(no deprecation).redis.py:RedisClientProtocol,RedisConnectionandRedisCachePersistenceLayerare now@deprecatedsubclasses of the correspondingCache*classes, keeping the old messages.mock.patchtargets to the new module location and added a regression test assertingCachePersistenceLayerdoes not warn whileRedisCachePersistenceLayerdoes.Testing
Behavior check: