Skip to content

Commit c33639e

Browse files
committed
🐛 Fix #50 properly import CMySQLConnection
1 parent 885b258 commit c33639e

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

mysql_to_sqlite3/transporter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313

1414
import mysql.connector
1515
import typing_extensions as tx
16-
from mysql.connector import CMySQLConnection, MySQLConnection, errorcode
16+
from mysql.connector import MySQLConnection, errorcode
17+
from mysql.connector.connection_cext import CMySQLConnection
1718
from mysql.connector.types import ToPythonOutputTypes
1819
from tqdm import tqdm, trange
1920

mysql_to_sqlite3/types.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from sqlite3 import Connection, Cursor
66

77
import typing_extensions as tx
8-
from mysql.connector import CMySQLConnection, MySQLConnection
8+
from mysql.connector import MySQLConnection
9+
from mysql.connector.connection_cext import CMySQLConnection
910
from mysql.connector.cursor import MySQLCursorDict, MySQLCursorPrepared, MySQLCursorRaw
1011

1112

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ classifiers = [
4040
]
4141
dependencies = [
4242
"Click>=8.1.3",
43-
"mysql-connector-python>=8.0.18,!=8.0.30,!=8.0.31",
43+
"mysql-connector-python>=8.0.33",
4444
"pytimeparse2",
4545
"python-slugify>=7.0.0",
4646
"simplejson>=3.19.0",

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
from docker.errors import NotFound
2323
from docker.models.containers import Container
2424
from faker import Faker
25-
from mysql.connector import CMySQLConnection, MySQLConnection, errorcode
25+
from mysql.connector import MySQLConnection, errorcode
26+
from mysql.connector.connection_cext import CMySQLConnection
2627
from mysql.connector.pooling import PooledMySQLConnection
2728
from requests import HTTPError
2829
from sqlalchemy.exc import IntegrityError

tests/func/mysql_to_sqlite3_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
from _pytest._py.path import LocalPath
1414
from _pytest.logging import LogCaptureFixture
1515
from faker import Faker
16-
from mysql.connector import CMySQLConnection, MySQLConnection, errorcode
16+
from mysql.connector import MySQLConnection, errorcode
17+
from mysql.connector.connection_cext import CMySQLConnection
1718
from mysql.connector.cursor import MySQLCursor
1819
from mysql.connector.pooling import PooledMySQLConnection
1920
from pytest_mock import MockFixture

0 commit comments

Comments
 (0)