-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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 AsyncFunctionCommands #2009
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2009 +/- ##
=======================================
Coverage 92.63% 92.63%
=======================================
Files 100 100
Lines 20909 20910 +1
=======================================
+ Hits 19369 19370 +1
Misses 1540 1540
Continue to review full report at Codecov.
|
""" | ||
Kill a function that is currently executing. | ||
|
||
For more information check https://redis.io/commands/function-kill | ||
""" | ||
return self.execute_command("FUNCTION KILL") | ||
|
||
def function_stats(self) -> list: | ||
def function_stats(self) -> Union[Awaitable[list], list]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Andrew-Chen-Wang Can you educate me. Why don't we use Union[Awaitable[List], List]
As you know type hints aren't my jam ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're basically the same. In Python 3.6, you can only do List[element type], but in 3.7+ you can use the built in list like list[element type]. However, in this case, I'm not using the getattr method at all so either List or list works.
Also this was before I found out the other type hints were merged 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HAHAHA Awesome. Thanks again @Andrew-Chen-Wang. I will always appreciate the education here.
* Add support for .lock() for RedisCluster * Update changelog with lua scripting and lock() changes * Also update asyncio client .lock() doc * Add Python 3.6 back to hash verify CI (#2008) * Renaming chore as maintenance (#2015) * Add AsyncFunctionCommands (#2009) * Also update asyncio client .lock() doc Co-authored-by: Chayim <chayim@users.noreply.github.com> Co-authored-by: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Co-authored-by: dvora-h <dvora.heller@redis.com>
Pull Request check-list
Please make sure to review and check all of these items:
$ tox
pass with this change (including linting)?NOTE: these things are not required to open a PR and can be done
afterwards / while the PR is open.
Description of change
Please provide a description of the change here.