Skip to content

Commit 2b2bba6

Browse files
committed
Fix pylint and mypy issues
1 parent 63fef88 commit 2b2bba6

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ repos:
3636
hooks:
3737
- id: isort
3838
- repo: https://github.com/pre-commit/mirrors-mypy
39-
rev: v1.7.0
39+
rev: v1.7.1
4040
hooks:
4141
- id: mypy
4242
additional_dependencies: [
43+
django,
4344
django-stubs,
4445
gssapi==1.8.1,
4546
dnspython==2.1.0,

mysql-connector-python/lib/mysql/connector/connection_cext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ def cmd_stmt_prepare(self, statement: bytes) -> CMySQLPrepStmt:
607607
raise InterfaceError(str(err)) from err
608608

609609
@with_context_propagation
610-
def cmd_stmt_execute( # type: ignore[override]
610+
def cmd_stmt_execute(
611611
self, statement_id: CMySQLPrepStmt, *args: Any
612612
) -> Optional[Union[CextEofPacketType, CextResultType]]:
613613
"""Executes the prepared statement"""

mysql-connector-python/lib/mysql/connector/django/base.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,9 @@ def adapt_datetime_with_timezone_support(value: datetime) -> StrOrBytes:
113113
)
114114
default_timezone = timezone.get_default_timezone()
115115
value = timezone.make_aware(value, default_timezone)
116-
value = value.astimezone(timezone.utc).replace(tzinfo=None)
116+
value = value.astimezone(timezone.utc).replace( # pylint: disable=no-member
117+
tzinfo=None
118+
)
117119
if HAVE_CEXT:
118120
mysql_datetime: bytes = datetime_to_mysql(value)
119121
return mysql_datetime
@@ -531,7 +533,7 @@ def is_usable(self) -> bool:
531533
return False
532534
return True
533535

534-
@cached_property # type: ignore[arg-type]
536+
@cached_property # type: ignore[misc]
535537
@staticmethod
536538
def display_name() -> str:
537539
"""Display name."""

0 commit comments

Comments
 (0)