memsql / memsql-python

This repository holds some python libraries and plugins designed to be used with MemSQL.
MIT License
62 stars 33 forks source link

`memsql-python` doesn't work with newest `mysqlclient` #20

Closed tomasz-at-nira closed 2 years ago

tomasz-at-nira commented 2 years ago

Issue: There has been a rename of parameters in connect() in mysqlclient https://github.com/PyMySQL/mysqlclient/pull/513

Installing latest memsql-python in a new python environment pulls latest mysqlclient. Code crashes.

Proposed solution: Either patch memsql-python or freeze requirement for mysqlclient to use an older version.

Log:

/home/tomasz/.cache/pypoetry/virtualenvs/app-kIoj1aan-py3.8/bin/python /home/tomasz/Desktop/memstore/app/main.py
Traceback (most recent call last):
  File "/home/tomasz/Desktop/memstore/app/main.py", line 15, in <module>
    MemsqlConnector().test_connection()
  File "/home/tomasz/Desktop/memstore/app/mqmsql/connector.py", line 29, in test_connection
    with self.get_connection(db="information_schema") as conn:
  File "/home/tomasz/Desktop/memstore/app/mqmsql/connector.py", line 20, in get_connection
    return database.connect(
  File "/home/tomasz/.cache/pypoetry/virtualenvs/app-kIoj1aan-py3.8/lib/python3.8/site-packages/memsql/common/database.py", line 19, in connect
    return Connection(*args, **kwargs)
  File "/home/tomasz/.cache/pypoetry/virtualenvs/app-kIoj1aan-py3.8/lib/python3.8/site-packages/memsql/common/database.py", line 62, in __init__
    self.reconnect()
  File "/home/tomasz/.cache/pypoetry/virtualenvs/app-kIoj1aan-py3.8/lib/python3.8/site-packages/memsql/common/database.py", line 93, in reconnect
    conn = _mysql.connect(**self._db_args)
TypeError: 'db' is an invalid keyword argument for connect()

Process finished with exit code 1
ngarg-panw commented 2 years ago

+1 . I wasted 2 days figuring this out. Right now I manually updated 'db' to 'database' and 'passwd' to 'password' locally in database.py to unblock myself.