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
(cherry picked from commit
489301137a4d76e5a46d754ae9c91aad2b3d2c1f)
--- /dev/null
+.. change::
+ :tags: bug, mysql
+ :tickets: 5821
+
+ 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".
+
connection, additional_tests
)
- def create_connect_args(self, url):
- opts = url.translate_connect_args(
- database="db", username="user", password="passwd"
- )
+ def create_connect_args(self, url, _translate_args=None):
+ if _translate_args is None:
+ _translate_args = dict(
+ database="db", username="user", password="passwd"
+ )
+
+ opts = url.translate_connect_args(**_translate_args)
opts.update(url.query)
util.coerce_kw_type(opts, "compress", bool)
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
+
[egg_info]
tag_build = dev
distclass=Distribution,
extras_require={
"mysql": ["mysqlclient"],
- "pymysql": ["pymysql"],
+ "pymysql": [
+ 'pymysql; python_version>="3"',
+ 'pymysql<1; python_version<"3"',
+ ],
"postgresql": ["psycopg2"],
"postgresql_psycopg2binary": ["psycopg2-binary"],
"postgresql_pg8000": ["pg8000"],
# needed only for correct profiling results
# due to speed improvements in mysqlclient as of 1.4.0
mysql: mysqlclient>=1.4.0
- mysql: pymysql
+ mysql: .[pymysql]
mysql: mysql-connector-python
py3{,5,6,7,8,9,10,11}-oracle: cx_oracle>=7.0