Skip to content

Commit

Permalink
Fix typing of function_list command
Browse files Browse the repository at this point in the history
  • Loading branch information
alisaifee committed Apr 18, 2024
1 parent 8964efb commit fb14ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions coredis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6363,7 +6363,7 @@ async def function_kill(self) -> bool:
)
async def function_list(
self, libraryname: Optional[StringT] = None, withcode: Optional[bool] = None
) -> Mapping[str, LibraryDefinition]:
) -> Mapping[AnyStr, LibraryDefinition]:
"""
List information about the functions registered under
:paramref:`libraryname`
Expand All @@ -6379,7 +6379,7 @@ async def function_list(
return await self.execute_command(
CommandName.FUNCTION_LIST,
*command_arguments,
callback=FunctionListCallback(),
callback=FunctionListCallback[AnyStr](),
)

@versionadded(version="3.1.0")
Expand Down
4 changes: 2 additions & 2 deletions coredis/response/_callbacks/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

class FunctionListCallback(
ResponseCallback[
List[ResponseType], List[ResponseType], Mapping[str, LibraryDefinition]
List[ResponseType], List[ResponseType], Mapping[AnyStr, LibraryDefinition]
]
):
def transform(
self, response: List[ResponseType], **options: Optional[ValueT]
) -> Mapping[str, LibraryDefinition]:
) -> Mapping[AnyStr, LibraryDefinition]:
libraries = [
EncodingInsensitiveDict(flat_pairs_to_dict(cast(List[ValueT], library)))
for library in response
Expand Down

0 comments on commit fb14ff6

Please sign in to comment.