Skip to content

Commit

Permalink
fix pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Adar Ovadia committed Jun 30, 2024
1 parent bd429d0 commit ba698bd
Show file tree
Hide file tree
Showing 6 changed files with 133 additions and 162 deletions.
3 changes: 1 addition & 2 deletions python/python/glide/async_commands/standalone_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
_build_sort_args,
)
from glide.async_commands.transaction import BaseTransaction, Transaction
from glide.async_commands.utils.utils import convert_bytes_to_string_dict
from glide.constants import OK, TOK, TResult
from glide.protobuf.redis_request_pb2 import RequestType

Expand Down Expand Up @@ -50,7 +49,7 @@ async def info(
Returns:
str: Returns a string containing the information for the sections requested.
bytes: Returns bytes containing the information for the sections requested.
"""
args = [section.value for section in sections] if sections else []
return cast(bytes, await self._execute_command(RequestType.Info, args))
Expand Down
61 changes: 0 additions & 61 deletions python/python/glide/async_commands/utils/utils.py

This file was deleted.

1 change: 0 additions & 1 deletion python/python/glide/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
# When routing to a single node, response will be T
# Otherwise, response will be : {Address : response , ... } with type of Dict[str, T].
TClusterResponse = Union[T, Dict[bytes, T]]
TClusterDecodedResponse = Union[T, Dict[str, T]]
TSingleNodeRoute = Union[RandomNode, SlotKeyRoute, SlotIdRoute, ByAddressRoute]
# When specifying legacy path (path doesn't start with `$`), response will be T
# Otherwise, (when specifying JSONPath), response will be List[Optional[T]].
Expand Down
4 changes: 2 additions & 2 deletions python/python/glide/glide_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ async def _execute_command(
request.callback_idx = self._get_callback_index()
request.single_command.request_type = request_type
request.single_command.args_array.args[:] = [
bytes(elem, encoding="utf8") for elem in args if isinstance(elem, str)
] # TODO - use arg pointer
bytes(elem, encoding="utf8") if isinstance(elem, str) else elem for elem in args
]
(encoded_args, args_size) = self._encode_and_sum_size(args)
if args_size < MAX_REQUEST_ARGS_LEN:
request.single_command.args_array.args[:] = encoded_args
Expand Down
Loading

0 comments on commit ba698bd

Please sign in to comment.