-
Notifications
You must be signed in to change notification settings - Fork 53
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 LIST
command.
#1738
Python: Add FUNCTION LIST
command.
#1738
Conversation
FUNCTION LIST
command.
library_name: Optional[str] = None, | ||
with_code: bool = False, | ||
route: Optional[Route] = None, | ||
) -> List[Mapping[bytes, Any]]: |
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.
- I guess you can use
str
for now (and for simplicity) - Replace
Any
with a real type (union of union of union ...)
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.
Looks like the exact return type should be List[Mapping[bytes, List[Mapping[bytes, Union[bytes, List[Mapping[bytes, Union[bytes, Set[bytes]]]]]]]]]
. Is this preferred over List[Mapping[bytes, Any]]
?
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.
No idea 🤷
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.
I introduced TFunctionListResponse
to constants.py to ease usage of this return type.
Co-authored-by: Yury-Fridlyand <[email protected]>
Co-authored-by: Aaron <[email protected]>
* FUNCTION LIST tracer code * update defaults * fix type hints * add tests * add client tests * update client tests with FUNCTION LIST * fix formatting * fix typing * update typing * typing updates * fix formatting * Apply suggestions from code review Co-authored-by: Aaron <[email protected]> * update response type to use bytes instead of str * formatting * add routing to function list tests * fix routing tests * update routing tests * fix tests * formatting * rename args, add docstrings, update tests * formatting * updated docstrings and tests * changelog * fix tests * update type definitions * Apply suggestions from code review Co-authored-by: Yury-Fridlyand <[email protected]> * update docstrings * Apply suggestions from code review Co-authored-by: Aaron <[email protected]> * minor cleanup * black fixes * fix typing * update to use TEncodable * introduce TFunctionListResponse to abstract away complex return type --------- Co-authored-by: Aaron <[email protected]> Co-authored-by: Yury-Fridlyand <[email protected]>
Issue #, if available: N/A
Description of changes:
https://redis.io/docs/latest/commands/function-list/
This is based off of the Java implementation from #1452
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.