Skip to content

Commit

Permalink
mypy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamazon committed Jun 26, 2024
1 parent 5cf6434 commit 30b2807
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions benchmarks/python/python_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
import redis.asyncio as redispy # type: ignore
from glide import (
BaseClientConfiguration,
GlideClient,
GlideClusterClient,
Logger,
LogLevel,
NodeAddress,
RedisClient,
RedisClusterClient,
)


Expand Down Expand Up @@ -288,7 +288,7 @@ async def main(

if clients_to_run == "all" or clients_to_run == "glide":
# Glide Socket
client_class = RedisClusterClient if is_cluster else RedisClient
client_class = GlideClusterClient if is_cluster else GlideClient
config = BaseClientConfiguration(
[NodeAddress(host=host, port=port)], use_tls=use_tls
)
Expand Down
14 changes: 7 additions & 7 deletions examples/python/client_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from glide import (
AllNodes,
BaseClientConfiguration,
GlideClient,
GlideClusterClient,
Logger,
LogLevel,
NodeAddress,
RedisClient,
RedisClusterClient,
)


Expand All @@ -28,7 +28,7 @@ def set_file_logger(level: LogLevel = LogLevel.WARN, file: Optional[str] = None)
Logger.set_logger_config(level, file)


async def send_set_and_get(client: Union[RedisClient, RedisClusterClient]):
async def send_set_and_get(client: Union[GlideClient, GlideClusterClient]):
set_response = await client.set("foo", "bar")
print(f"Set response is = {set_response}")
get_response = await client.get("foo")
Expand All @@ -39,14 +39,14 @@ async def test_standalone_client(host: str = "localhost", port: int = 6379):
# When in Redis is in standalone mode, add address of the primary node,
# and any replicas you'd like to be able to read from.
addresses = [NodeAddress(host, port)]
# Check `RedisClientConfiguration/ClusterClientConfiguration` for additional options.
# Check `GlideClientConfiguration/ClusterClientConfiguration` for additional options.
config = BaseClientConfiguration(
addresses=addresses,
client_name="test_standalone_client",
# if the server use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
# use_tls=True
)
client = await RedisClient.create(config)
client = await GlideClient.create(config)

# Send SET and GET
await send_set_and_get(client)
Expand All @@ -58,14 +58,14 @@ async def test_standalone_client(host: str = "localhost", port: int = 6379):
async def test_cluster_client(host: str = "localhost", port: int = 6379):
# When in Redis is cluster mode, add address of any nodes, and the client will find all nodes in the cluster.
addresses = [NodeAddress(host, port)]
# Check `RedisClientConfiguration/ClusterClientConfiguration` for additional options.
# Check `GlideClientConfiguration/ClusterClientConfiguration` for additional options.
config = BaseClientConfiguration(
addresses=addresses,
client_name="test_cluster_client",
# if the cluster nodes use TLS, you'll need to enable it. Otherwise the connection attempt will time out silently.
# use_tls=True
)
client = await RedisClusterClient.create(config)
client = await GlideClusterClient.create(config)

# Send SET and GET
await send_set_and_get(client)
Expand Down
2 changes: 1 addition & 1 deletion python/python/tests/tests_redis_modules/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from glide.config import ProtocolVersion
from glide.constants import OK
from glide.exceptions import RequestError
from glide.redis_client import TGlideClient
from glide.glide_client import TGlideClient
from tests.test_async_client import get_random_string, parse_info_response


Expand Down

0 comments on commit 30b2807

Please sign in to comment.