aiocache icon indicating copy to clipboard operation
aiocache copied to clipboard

Decorator @cached creates cache with the Cache() factory

Open padraic-shafer opened this issue 2 years ago • 1 comments

  • See #473 ~~: Deprecate using cache specific constructors~~ ~~* https://github.com/aio-libs/aiocache/issues/473~~
    • Cache class was introduced as a proxy for instantiating the different backends. There should be only one way of doing things and Cache is the preferred way of doing that so will deprecate the others.
  • This is now applied to cached._get_cache()

What do these changes do?

Decorator @cached creates cache with the Cache() factory constructor, instead of the cache-specific constructor.

Are there changes in behavior for the user?

This should be invisible to the end user.

Related issue number

#473: Deprecate using cache specific constructors

Checklist

  • [X] I think the code is well written
  • [ ] Unit tests for the changes exist
  • [ ] Documentation reflects the changes
  • [ ] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> (e.g. 588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the PR
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: Fix issue with non-ascii contents in doctest text files.

padraic-shafer avatar Apr 24 '22 00:04 padraic-shafer

Hi, do you have an feedback for this PR?

padraic-shafer avatar May 29 '22 14:05 padraic-shafer

As mentioned in that issue, doesn't look like the deprecation has actually happened yet. But, might as well update this.

Dreamsorcerer avatar Dec 30 '22 22:12 Dreamsorcerer

Codecov Report

Merging #568 (c17933e) into master (e64ff89) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #568   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files          36       36           
  Lines        3560     3560           
  Branches      447      447           
=======================================
  Hits         3546     3546           
  Misses         12       12           
  Partials        2        2           
Flag Coverage Δ
unit 99.57% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
aiocache/decorators.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update e64ff89...c17933e. Read the comment docs.

codecov[bot] avatar Dec 30 '22 22:12 codecov[bot]