Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for EXPIRE command's options #2002

Merged
merged 9 commits into from
Mar 14, 2022

Conversation

dogukanteber
Copy link
Contributor

@dogukanteber dogukanteber commented Feb 19, 2022

Pull Request check-list

Please make sure to review and check all of these items:

  • Does $ tox pass with this change (including linting)?
  • Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Is there an example added to the examples folder (if applicable)?
  • Is the changes added to CHANGES file?

NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.

Description of change

closes #1949

@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2022

Codecov Report

Merging #2002 (f5bcebd) into master (c5d19b8) will decrease coverage by 0.52%.
The diff coverage is 48.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2002      +/-   ##
==========================================
- Coverage   92.63%   92.11%   -0.53%     
==========================================
  Files         100      100              
  Lines       20921    21054     +133     
==========================================
+ Hits        19381    19393      +12     
- Misses       1540     1661     +121     
Impacted Files Coverage Δ
tests/test_commands.py 98.56% <38.09%> (-0.71%) ⬇️
redis/commands/core.py 85.70% <83.33%> (-1.49%) ⬇️
tests/test_function.py 25.30% <0.00%> (-74.70%) ⬇️
redis/commands/timeseries/__init__.py 94.73% <0.00%> (-5.27%) ⬇️
redis/commands/json/__init__.py 97.56% <0.00%> (-2.44%) ⬇️
redis/commands/parser.py 88.40% <0.00%> (-1.92%) ⬇️
redis/cluster.py 91.93% <0.00%> (-0.51%) ⬇️
redis/commands/search/commands.py 89.02% <0.00%> (-0.22%) ⬇️
... and 7 more

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 c5d19b8...f5bcebd. Read the comment docs.

redis/commands/core.py Outdated Show resolved Hide resolved
redis/commands/core.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chayim chayim left a comment

Choose a reason for hiding this comment

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

@dogukanteber If I might beg (yeah, beg!) small changes? But this is fantastically close. As always, thank you for your support!

@chayim chayim added feature New feature redis-7 labels Feb 22, 2022
@dogukanteber
Copy link
Contributor Author

Of course. My pleasure @chayim.

@chayim
Copy link
Contributor

chayim commented Feb 24, 2022

@dogukanteber Awesome as always. I just merged master back into your branch to make sure that things play nice - and we'll get this in and ready for 4.2.0rc2.

@@ -1490,16 +1490,28 @@ def exists(self, *names: KeyT) -> ResponseT:

__contains__ = exists

def expire(self, name: KeyT, time: ExpiryT) -> ResponseT:
def expire(self, name: KeyT, time: ExpiryT, option: str = None) -> ResponseT:
Copy link
Contributor

Choose a reason for hiding this comment

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

@dogukanteber Sorry, did I miss something? I swear I saw this PR origially including these optoins as items in the function header (i.e separate NX, XX, etc). If not... what do you think about doing that? It would match our other functions!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have pushed some changes @chayim. Does it match with other functions?

@chayim chayim self-requested a review March 2, 2022 10:37
@dvora-h
Copy link
Collaborator

dvora-h commented Mar 14, 2022

@dogukanteber I just pushed a small fix (I hope you don't mind!) so the options will be consistent with options in other functions (like set etc.), now it's ready and we'll include it in the next release, thank you!

@dvora-h dvora-h merged commit 2c40585 into redis:master Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for EXPIRE redis-7 options [NX|XX|GT|LT]
4 participants