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 EXPIREAT command's options #2024

Merged
merged 8 commits into from Mar 14, 2022

Conversation

dogukanteber
Copy link
Contributor

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)?
  • Was the change 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 #1950

@codecov-commenter
Copy link

codecov-commenter commented Mar 2, 2022

Codecov Report

Merging #2024 (fcdde6e) into master (6df0019) will decrease coverage by 0.11%.
The diff coverage is 34.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2024      +/-   ##
==========================================
- Coverage   92.17%   92.06%   -0.12%     
==========================================
  Files         100      100              
  Lines       21024    21063      +39     
==========================================
+ Hits        19379    19391      +12     
- Misses       1645     1672      +27     
Impacted Files Coverage Δ
tests/test_commands.py 98.16% <24.24%> (-0.84%) ⬇️
redis/commands/core.py 85.79% <75.00%> (-0.07%) ⬇️

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 6df0019...fcdde6e. Read the comment docs.

@@ -1501,16 +1501,28 @@ def expire(self, name: KeyT, time: ExpiryT) -> ResponseT:
time = int(time.total_seconds())
return self.execute_command("EXPIRE", name, time)

def expireat(self, name: KeyT, when: AbsExpiryT) -> ResponseT:
def expireat(self, name: KeyT, when: AbsExpiryT, 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 WDYT about making these options (NX, XX, etc) variables in the function header. IMHO it would watch our other functions.

@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 eac3a34 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 EXPIREAT redis-7 [NX|XX|GT|LT]
4 participants