diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-07 12:20:51 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-07 14:08:24 -0500 |
commit | 489301137a4d76e5a46d754ae9c91aad2b3d2c1f (patch) | |
tree | 23735023f7603df79cc0137c72c1d9bf8e52b329 /lib/sqlalchemy/dialects/mysql/aiomysql.py | |
parent | 6c5de1e3ee5c6f24cc6f6c863acc86c77fa99a1e (diff) | |
download | sqlalchemy-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/aiomysql.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/aiomysql.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/aiomysql.py b/lib/sqlalchemy/dialects/mysql/aiomysql.py index 6381027e9..f0665133f 100644 --- a/lib/sqlalchemy/dialects/mysql/aiomysql.py +++ b/lib/sqlalchemy/dialects/mysql/aiomysql.py @@ -264,10 +264,9 @@ class MySQLDialect_aiomysql(MySQLDialect_pymysql): return pool.AsyncAdaptedQueuePool def create_connect_args(self, url): - args, kw = super(MySQLDialect_aiomysql, self).create_connect_args(url) - if "passwd" in kw: - kw["password"] = kw.pop("passwd") - return args, kw + return super(MySQLDialect_aiomysql, self).create_connect_args( + url, _translate_args=dict(username="user", database="db") + ) def is_disconnect(self, e, connection, cursor): if super(MySQLDialect_aiomysql, self).is_disconnect( |