-
Notifications
You must be signed in to change notification settings - Fork 71
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
Python: Add FUNCTION STATS command #1794
Python: Add FUNCTION STATS command #1794
Conversation
python/python/tests/utils/utils.py
Outdated
function_count (int): Expected functions count. | ||
""" | ||
running_script_info = response.get(b"running_script") | ||
if running_script_info == None and len(running_function) != 0: |
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.
Use is None
instead of == None
, and is not None
instead of != None
in python
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.
Please, add a changelog entry
@@ -7951,6 +7952,153 @@ async def test_function_delete_with_routing( | |||
await redis_client.function_delete(lib_name) | |||
assert "Library not found" in str(e) | |||
|
|||
@pytest.mark.parametrize("cluster_mode", [False]) | |||
@pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) | |||
async def test_function_stats(self, redis_client: GlideClient): |
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.
Please rename redis_client
to glide_client
Returns information about the function that's currently running and information about the | ||
available execution engines. | ||
|
||
See https://redis.io/commands/function-stats/ for more details |
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.
Are we sure we want to mix use redis.io
and valkey.io
? Most python commands use valkey.io
though.
* Add cluster and standalone versions of FUNCTION STATS commands * Add transaction implementation for FUNCTION STATS * Start adding tests for FUNCTION STATS * Try finish implementing tests * Fix some issues in the tests * Fix tests * Document check_function_stats_response * Run linters and formatters * Import pytest * Fix import ordering * Fix mypy errors * Fix transaction tests * Address PR comments * Fix black lint * Address minor PR comments --------- Co-authored-by: aaron-congo <[email protected]>
Issue #, if available:
N/A
This PR adds the FUNCTION STATS command for the Python wrapper.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.