From 412819d4d5774c3d4688c5b57ba73b0619b4f94f Mon Sep 17 00:00:00 2001 From: cecily_carver Date: Wed, 18 Dec 2024 17:07:16 -0800 Subject: [PATCH] Suppressing some lint errors, adding type assignment. --- mysql_mimic/connection.py | 2 ++ mysql_mimic/packets.py | 5 +++-- mysql_mimic/results.py | 1 + mysql_mimic/schema.py | 2 +- mysql_mimic/server.py | 1 + mysql_mimic/utils.py | 2 +- 6 files changed, 9 insertions(+), 4 deletions(-) diff --git a/mysql_mimic/connection.py b/mysql_mimic/connection.py index 5160192..a517e42 100644 --- a/mysql_mimic/connection.py +++ b/mysql_mimic/connection.py @@ -36,6 +36,7 @@ class Connection: _MAX_PREPARED_STMT_ID = 2**32 + # pylint: disable=too-many-positional-arguments def __init__( self, stream: MysqlStream, @@ -196,6 +197,7 @@ async def handle_change_user(self, data: bytes) -> None: await self.session.reset() + # pylint: disable=too-many-positional-arguments async def authenticate( self, username: str, diff --git a/mysql_mimic/packets.py b/mysql_mimic/packets.py index 19604d0..cbd93c5 100644 --- a/mysql_mimic/packets.py +++ b/mysql_mimic/packets.py @@ -114,7 +114,7 @@ class ComFieldList: wildcard: str -def make_ok( +def make_ok( # pylint: disable=too-many-positional-arguments capabilities: Capabilities, status_flags: ServerStatus, eof: bool = False, @@ -170,7 +170,7 @@ def make_error( return _concat(*parts) -def make_handshake_v10( +def make_handshake_v10( # pylint: disable=too-many-positional-arguments capabilities: Capabilities, server_charset: CharacterSet, server_version: str, @@ -338,6 +338,7 @@ def make_column_count(capabilities: Capabilities, column_count: int) -> bytes: # pylint: disable=too-many-arguments +# pylint: disable=too-many-positional-arguments def make_column_definition_41( server_charset: CharacterSet, schema: Optional[str] = None, diff --git a/mysql_mimic/results.py b/mysql_mimic/results.py index 9716207..712dd44 100644 --- a/mysql_mimic/results.py +++ b/mysql_mimic/results.py @@ -37,6 +37,7 @@ class ResultColumn: binary_encoder: Optionally override the function used to encode values for MySQL's binary protocol """ + # pylint: disable=too-many-positional-arguments def __init__( self, name: str, diff --git a/mysql_mimic/schema.py b/mysql_mimic/schema.py index c3107a0..aadfabe 100644 --- a/mysql_mimic/schema.py +++ b/mysql_mimic/schema.py @@ -327,7 +327,7 @@ def like_to_regex(like: str) -> re.Pattern: def contains_column_metadata(schema: dict, depth: int) -> bool: - sub_dict = schema + sub_dict: Any = schema # Find the innermost dictionary. for _ in range(depth - 1): diff --git a/mysql_mimic/server.py b/mysql_mimic/server.py index 6410a1e..a595440 100644 --- a/mysql_mimic/server.py +++ b/mysql_mimic/server.py @@ -40,6 +40,7 @@ class MysqlServer: **kwargs: extra keyword args passed to the asyncio start server command """ + # pylint: disable=too-many-positional-arguments def __init__( self, session_factory: Callable[[], BaseSession | Awaitable[BaseSession]] = Session, diff --git a/mysql_mimic/utils.py b/mysql_mimic/utils.py index e1444af..7fcb98b 100644 --- a/mysql_mimic/utils.py +++ b/mysql_mimic/utils.py @@ -3,7 +3,7 @@ import asyncio import inspect import sys -from collections.abc import Iterator +from collections.abc import Iterator # pylint: disable=import-error import random from typing import List, TypeVar, AsyncIterable, Iterable, AsyncIterator, cast import string