diff --git a/python/python/glide/async_commands/cluster_commands.py b/python/python/glide/async_commands/cluster_commands.py index 6110333475..c441272d9f 100644 --- a/python/python/glide/async_commands/cluster_commands.py +++ b/python/python/glide/async_commands/cluster_commands.py @@ -12,16 +12,7 @@ _build_sort_args, ) from glide.async_commands.transaction import BaseTransaction, ClusterTransaction -from glide.async_commands.utils.utils import ( - convert_bytes_to_string_cluster_response, - convert_bytes_to_string_dict, -) -from glide.constants import ( - TOK, - TClusterResponse, - TResult, - TSingleNodeRoute, -) +from glide.constants import TOK, TClusterResponse, TResult, TSingleNodeRoute from glide.protobuf.redis_request_pb2 import RequestType from glide.routes import Route diff --git a/python/python/glide/async_commands/utils/utils.py b/python/python/glide/async_commands/utils/utils.py index d75e905a1b..88defe0061 100644 --- a/python/python/glide/async_commands/utils/utils.py +++ b/python/python/glide/async_commands/utils/utils.py @@ -4,8 +4,10 @@ def convert_bytes_to_string_dict( - # TODO: remove the str options - byte_string_dict: Optional[Union[Mapping[bytes, Any], Dict[bytes, Any], Mapping[str, Any], Dict[str, Any]]] + # TODO: remove the str options + byte_string_dict: Optional[ + Union[Mapping[bytes, Any], Dict[bytes, Any], Mapping[str, Any], Dict[str, Any]] + ] ) -> Optional[Dict[str, Any]]: """ Recursively convert the keys and values of a dictionary from byte strings to regular strings, diff --git a/python/python/tests/test_async_client.py b/python/python/tests/test_async_client.py index c4cdb96390..69b482bfff 100644 --- a/python/python/tests/test_async_client.py +++ b/python/python/tests/test_async_client.py @@ -678,7 +678,9 @@ async def test_config_get_set(self, redis_client: TGlideClient): assert isinstance(previous_timeout_decoded, dict) assert isinstance(previous_timeout_decoded["timeout"], str) assert ( - await redis_client.config_set({"timeout": previous_timeout_decoded["timeout"]}) + await redis_client.config_set( + {"timeout": previous_timeout_decoded["timeout"]} + ) == OK ) @@ -5356,7 +5358,10 @@ async def test_xgroup_create_consumer_xreadgroup_xgroup_del_consumer( # now xreadgroup yields one empty stream entry and one non-empty stream entry assert await redis_client.xreadgroup({key: "0"}, group_name, consumer_name) == { - key.encode(): {stream_id1_0.encode(): None, stream_id1_1.encode(): [[b"f1_1", b"v1_1"]]} + key.encode(): { + stream_id1_0.encode(): None, + stream_id1_1.encode(): [[b"f1_1", b"v1_1"]], + } } assert ( @@ -6876,7 +6881,9 @@ async def test_function_load_cluster_with_route( lib_name, {func_name: "return args[1]", func2_name: "return #args"}, True ) - assert await redis_client.function_load(new_code, True, route) == lib_name.encode() + assert ( + await redis_client.function_load(new_code, True, route) == lib_name.encode() + ) @pytest.mark.parametrize("cluster_mode", [True, False]) @pytest.mark.parametrize("protocol", [ProtocolVersion.RESP2, ProtocolVersion.RESP3]) diff --git a/python/python/tests/test_pubsub.py b/python/python/tests/test_pubsub.py index 6b66041f74..8453a2d423 100644 --- a/python/python/tests/test_pubsub.py +++ b/python/python/tests/test_pubsub.py @@ -77,6 +77,7 @@ async def create_two_clients( ) return client, client2 + def decode_pubsub_msg(msg: Optional[CoreCommands.PubSubMsg]) -> CoreCommands.PubSubMsg: if not msg: return CoreCommands.PubSubMsg("", "", None) @@ -86,6 +87,7 @@ def decode_pubsub_msg(msg: Optional[CoreCommands.PubSubMsg]) -> CoreCommands.Pub decoded_msg = CoreCommands.PubSubMsg(string_msg, string_channel, string_pattern) return decoded_msg + async def get_message_by_method( method: MethodTesting, client: TGlideClient, diff --git a/python/python/tests/test_transaction.py b/python/python/tests/test_transaction.py index 784e185e17..e0f93fe46b 100644 --- a/python/python/tests/test_transaction.py +++ b/python/python/tests/test_transaction.py @@ -57,9 +57,9 @@ from tests.conftest import create_client from tests.utils.utils import ( check_if_server_version_lt, + convert_bytes_to_string_dict, generate_lua_lib_code, get_random_string, - convert_bytes_to_string_dict, ) diff --git a/python/python/tests/utils/utils.py b/python/python/tests/utils/utils.py index 248e28eb10..1d33fce74a 100644 --- a/python/python/tests/utils/utils.py +++ b/python/python/tests/utils/utils.py @@ -1,7 +1,7 @@ import json import random import string -from typing import Any, cast, Dict, List, Mapping, Optional, TypeVar, Union +from typing import Any, Dict, List, Mapping, Optional, TypeVar, Union, cast from glide.async_commands.core import InfoSection from glide.async_commands.utils.utils import convert_bytes_to_string_dict