Skip to content

Commit a6c122f

Browse files
committed
Fix ci
1 parent aa64ab2 commit a6c122f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

asyncmy/cursors.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import re
33
import time
4+
import typing
45
import warnings
56

67
from . import errors
@@ -15,6 +16,8 @@
1516
re.IGNORECASE | re.DOTALL,
1617
)
1718
logger = logging.getLogger(__package__)
19+
if typing.TYPE_CHECKING:
20+
from asyncmy.connection import Connection
1821

1922

2023
class Cursor:
@@ -34,7 +37,7 @@ class Cursor:
3437
#: Default value of max_allowed_packet is 1048576.
3538
max_stmt_length = 1024000
3639

37-
def __init__(self, connection, echo=False):
40+
def __init__(self, connection: "Connection", echo=False):
3841
self.connection = connection
3942
self.description = None
4043
self.rownumber = 0
@@ -174,7 +177,7 @@ async def execute(self, query, args=None):
174177
end = time.time()
175178
self._executed = query
176179
if self._echo:
177-
logger.info(f"[{round((end-start) *1000,2)}ms] {query}")
180+
logger.info(f"[{round((end - start) * 1000, 2)}ms] {query}")
178181
return result
179182

180183
async def executemany(self, query, args):
@@ -378,7 +381,7 @@ async def _do_get_result(self):
378381
if result.warning_count > 0:
379382
await self._show_warnings(conn)
380383

381-
async def _show_warnings(self, conn):
384+
async def _show_warnings(self, conn: "Connection"):
382385
if self._result and self._result.has_next:
383386
return
384387
ws = await conn.show_warnings()

examples/replication.py

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import asyncio
22

3-
import pytest
4-
53
from asyncmy import connect
64
from asyncmy.replication import BinLogStream
75
from asyncmy.replication.row_events import WriteRowsEvent

0 commit comments

Comments
 (0)