Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Remove __del__ from Redis (Fixes #1115) #1227

Merged
merged 6 commits into from Dec 16, 2021
Merged

Conversation

Andrew-Chen-Wang
Copy link
Collaborator

@Andrew-Chen-Wang Andrew-Chen-Wang commented Dec 2, 2021

What do these changes do?

Removes __del__ from Redis

Are there changes in behavior for the user?

Yes, you should explicitly disconnect and not use __del__

Related issue number

Fixes #1115

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • 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.
  • 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.

@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #1227 (a121f9a) into master (dbdd0ad) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1227      +/-   ##
==========================================
- Coverage   90.67%   90.66%   -0.01%     
==========================================
  Files          21       21              
  Lines        6875     6869       -6     
  Branches      794      793       -1     
==========================================
- Hits         6234     6228       -6     
  Misses        469      469              
  Partials      172      172              
Flag Coverage Δ
unit 90.58% <100.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
aioredis/client.py 82.47% <100.00%> (-0.09%) ⬇️
tests/conftest.py 92.41% <0.00%> (+0.16%) ⬆️

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 dbdd0ad...a121f9a. Read the comment docs.

@Dreamsorcerer
Copy link
Contributor

I'm fine with this, but better would be to copy the code in aiohttp to raise a warning:
https://github.com/aio-libs/aiohttp/blob/master/aiohttp/client.py#L294-L309

Copy link
Collaborator

@bmerry bmerry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have anything to add to what @Dreamsorcerer has said.

@Andrew-Chen-Wang Andrew-Chen-Wang requested review from bmerry and removed request for bmerry December 15, 2021 17:55
aioredis/client.py Outdated Show resolved Hide resolved
aioredis/client.py Outdated Show resolved Hide resolved
* Fixed getting proper event loop
@Andrew-Chen-Wang
Copy link
Collaborator Author

@bmerry @seandstewart sorry for the spam requests for review. After abrookins left, I'm wondering who still currently has power for approving PRs to be merged?

@seandstewart
Copy link
Collaborator

@Andrew-Chen-Wang - I believe you should have power to merge this. LGTM 🚢

@Andrew-Chen-Wang Andrew-Chen-Wang merged commit 7f65c4c into master Dec 16, 2021
@Andrew-Chen-Wang Andrew-Chen-Wang deleted the remove-del-1115 branch December 16, 2021 03:15
@Andrew-Chen-Wang
Copy link
Collaborator Author

Thanks @seandstewart . To clarify, PRs require authorized reviewers to approve PRs before they get merged. Just wondering besides us two, who else has the privilege to approve PRs since I feel guilty spam requesting reviews 😅

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning caused by Redis.__del__()
4 participants