summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/mysql/pymysql.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-01-07 12:20:51 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2021-01-07 14:08:24 -0500
commit489301137a4d76e5a46d754ae9c91aad2b3d2c1f (patch)
tree23735023f7603df79cc0137c72c1d9bf8e52b329 /lib/sqlalchemy/dialects/mysql/pymysql.py
parent6c5de1e3ee5c6f24cc6f6c863acc86c77fa99a1e (diff)
downloadsqlalchemy-489301137a4d76e5a46d754ae9c91aad2b3d2c1f.tar.gz
Update connect args for pymysql 1.0.0; aiomysql fixes
Fixed deprecation warnings that arose as a result of the release of PyMySQL 1.0, including deprecation warnings for the "db" and "passwd" parameters now replaced with "database" and "password". For the 1.4 version of this patch, we are also changing tox.ini to refer to a local branch of aiomysql that fixes pymysql compatibility issues. Fixes: #5821 Change-Id: I93876b52b2d96b52308f22aeb4f244ac5766a82f
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/pymysql.py')
-rw-r--r--lib/sqlalchemy/dialects/mysql/pymysql.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/pymysql.py b/lib/sqlalchemy/dialects/mysql/pymysql.py
index ad61c9e29..0c321f854 100644
--- a/lib/sqlalchemy/dialects/mysql/pymysql.py
+++ b/lib/sqlalchemy/dialects/mysql/pymysql.py
@@ -57,6 +57,13 @@ class MySQLDialect_pymysql(MySQLDialect_mysqldb):
def dbapi(cls):
return __import__("pymysql")
+ def create_connect_args(self, url, _translate_args=None):
+ if _translate_args is None:
+ _translate_args = dict(username="user")
+ return super(MySQLDialect_pymysql, self).create_connect_args(
+ url, _translate_args=_translate_args
+ )
+
def is_disconnect(self, e, connection, cursor):
if super(MySQLDialect_pymysql, self).is_disconnect(
e, connection, cursor