aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

docs: Update redis to follow the latest spec

Open rapsealk opened this issue 2 years ago • 1 comments

What do these changes do?

I changed some Redis code from the documentation to follow the latest API. It is based on redis-py>=4.2.x on which aioredis has been merged and started to be maintained.

Are there changes in behavior for the user?

Nope!

Related issue number

There is no issue related to this PR.

Checklist

  • [x] I think the code is well written
  • [ ] Unit tests for the changes exist
  • [x] Documentation reflects the changes
  • [ ] If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • [x] Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (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."

Thank you for reading and any feedback is always welcomed!

rapsealk avatar Sep 06 '22 01:09 rapsealk

@Dreamsorcerer Deeply appreciated your feedback! I made some changes following your advice. Also, I found that Redis supports async context manager, it resets and releases a connection when __aexit__ is called. https://github.com/redis/redis-py/blob/510d8fe089addaea65055aae1e9606d0f40829d4/redis/asyncio/client.py#L651-L668

rapsealk avatar Sep 08 '22 00:09 rapsealk

https://github.com/redis/redis-py/issues/2419

Dreamsorcerer avatar Oct 16 '22 14:10 Dreamsorcerer

Codecov Report

Merging #6907 (e610e4b) into master (a1fa908) will increase coverage by 4.08%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #6907      +/-   ##
==========================================
+ Coverage   93.42%   97.50%   +4.08%     
==========================================
  Files         104      103       -1     
  Lines       30730    29990     -740     
  Branches     3753     3643     -110     
==========================================
+ Hits        28708    29243     +535     
+ Misses       1848      567    -1281     
- Partials      174      180       +6     
Flag Coverage Δ
CI-GHA 97.41% <ø> (?)
OS-Linux 97.05% <ø> (?)
OS-Windows 95.39% <ø> (?)
OS-macOS 96.69% <ø> (?)
Py-3.10.8 97.16% <ø> (?)
Py-3.11.0 96.56% <ø> (?)
Py-3.7.15 96.88% <ø> (?)
Py-3.7.9 95.28% <ø> (?)
Py-3.8.10 95.18% <ø> (?)
Py-3.8.14 96.78% <ø> (?)
Py-3.9.13 95.17% <ø> (?)
Py-3.9.14 96.57% <ø> (?)
Py-3.9.15 96.76% <ø> (?)
Py-pypy7.3.9 96.44% <ø> (?)
VM-macos 96.69% <ø> (?)
VM-ubuntu 97.05% <ø> (?)
VM-windows 95.39% <ø> (?)
unit ?

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

Impacted Files Coverage Δ
tests/test_circular_imports.py 93.54% <0.00%> (-6.46%) :arrow_down:
tests/test_web_response.py 97.52% <0.00%> (-1.96%) :arrow_down:
aiohttp/helpers.py 95.38% <0.00%> (-0.41%) :arrow_down:
tests/test_client_session.py 99.56% <0.00%> (-0.01%) :arrow_down:
aiohttp/abc.py 100.00% <0.00%> (ø)
aiohttp/web.py 99.17% <0.00%> (ø)
tests/test_streams.py 100.00% <0.00%> (ø)
tests/test_cookiejar.py 99.09% <0.00%> (ø)
tests/test_multipart.py 100.00% <0.00%> (ø)
tests/test_web_exceptions.py 100.00% <0.00%> (ø)
... and 33 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Oct 25 '22 19:10 codecov[bot]

Upstream examples have been updated, so this looks correct.

Dreamsorcerer avatar Oct 30 '22 12:10 Dreamsorcerer

Backport to 3.9: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.9/0af182ae0ec3980b9164bf0b9ce9a3dc69b5b8ff/pr-6907

Backported as https://github.com/aio-libs/aiohttp/pull/7059

🤖 @patchback I'm built with octomachinery and my source is open — https://github.com/sanitizers/patchback-github-app.

patchback[bot] avatar Oct 30 '22 13:10 patchback[bot]