Skip to content

Commit

Permalink
Fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Sep 7, 2021
1 parent aa64ab2 commit a6c122f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions asyncmy/cursors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import logging
import re
import time
import typing
import warnings

from . import errors
Expand All @@ -15,6 +16,8 @@
re.IGNORECASE | re.DOTALL,
)
logger = logging.getLogger(__package__)
if typing.TYPE_CHECKING:
from asyncmy.connection import Connection


class Cursor:
Expand All @@ -34,7 +37,7 @@ class Cursor:
#: Default value of max_allowed_packet is 1048576.
max_stmt_length = 1024000

def __init__(self, connection, echo=False):
def __init__(self, connection: "Connection", echo=False):
self.connection = connection
self.description = None
self.rownumber = 0
Expand Down Expand Up @@ -174,7 +177,7 @@ async def execute(self, query, args=None):
end = time.time()
self._executed = query
if self._echo:
logger.info(f"[{round((end-start) *1000,2)}ms] {query}")
logger.info(f"[{round((end - start) * 1000, 2)}ms] {query}")
return result

async def executemany(self, query, args):
Expand Down Expand Up @@ -378,7 +381,7 @@ async def _do_get_result(self):
if result.warning_count > 0:
await self._show_warnings(conn)

async def _show_warnings(self, conn):
async def _show_warnings(self, conn: "Connection"):
if self._result and self._result.has_next:
return
ws = await conn.show_warnings()
Expand Down
2 changes: 0 additions & 2 deletions examples/replication.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import asyncio

import pytest

from asyncmy import connect
from asyncmy.replication import BinLogStream
from asyncmy.replication.row_events import WriteRowsEvent
Expand Down

0 comments on commit a6c122f

Please sign in to comment.