Skip to content
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

Upgrade Flake8 #3323

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
black==24.3.0
cachetools
click==8.0.4
flake8-isort==6.0.0
flake8==5.0.4
flake8-isort
flake8
flynt~=0.69.0
invoke==2.2.0
mock
Expand Down
2 changes: 1 addition & 1 deletion redis/_parsers/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def parse_geosearch_generic(response, **options):
except KeyError: # it means the command was sent via execute_command
return response

if type(response) != list:
if not isinstance(response, list):
response_list = [response]
else:
response_list = response
Expand Down
3 changes: 0 additions & 3 deletions redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1380,9 +1380,6 @@ def failover(self):
)


AsyncManagementCommands = ManagementCommands


class AsyncManagementCommands(ManagementCommands):
async def command_info(self, **kwargs) -> None:
return super().command_info(**kwargs)
Expand Down
2 changes: 1 addition & 1 deletion redis/commands/timeseries/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __init__(self, args):
self.chunk_size = response["chunkSize"]
if "duplicatePolicy" in response:
self.duplicate_policy = response["duplicatePolicy"]
if type(self.duplicate_policy) == bytes:
if isinstance(self.duplicate_policy, bytes):
self.duplicate_policy = self.duplicate_policy.decode()

def get(self, item):
Expand Down
6 changes: 2 additions & 4 deletions redis/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@
class CommandsProtocol(Protocol):
connection_pool: Union["AsyncConnectionPool", "ConnectionPool"]

def execute_command(self, *args, **options): ...
def execute_command(self, *args, **options) -> ResponseT: ...


class ClusterCommandsProtocol(CommandsProtocol, Protocol):
class ClusterCommandsProtocol(CommandsProtocol):
encoder: "Encoder"

def execute_command(self, *args, **options) -> Union[Any, Awaitable]: ...
1 change: 0 additions & 1 deletion tests/test_asyncio/test_connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,6 @@ def test_connect_from_url_tcp(self):
connection = redis.Redis.from_url("redis://localhost")
pool = connection.connection_pool

print(repr(pool))
assert re.match(
r"< .*?([^\.]+) \( < .*?([^\.]+) \( (.+) \) > \) >", repr(pool), re.VERBOSE
).groups() == (
Expand Down
2 changes: 1 addition & 1 deletion tests/test_asyncio/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,4 +237,4 @@ def __init__(self, *args, **kwargs):
pass

lock = r.lock("foo", lock_class=MyLock)
assert type(lock) == MyLock
assert isinstance(lock, MyLock)
1 change: 0 additions & 1 deletion tests/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ def test_json_forget_with_dollar(client):
client.json().forget("not_a_document", "..a")


@pytest.mark.onlynoncluster
@pytest.mark.redismod
def test_json_mget_dollar(client):
# Test mget with multi paths
Expand Down
2 changes: 1 addition & 1 deletion tests/test_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,4 +257,4 @@ def __init__(self, *args, **kwargs):
pass

lock = r.lock("foo", lock_class=MyLock)
assert type(lock) == MyLock
assert isinstance(lock, MyLock)
Loading