Remove mysql-connector dependency #1200
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While testing #1150, @cmadjar encountered an issue when connecting to the database through SQLAlchemy. I suspect this is because this connection is using a deprecated version of
mysql-connector
. This dependency was already present in LORIS-MRI before adding SQLAlchemy although it was unused, and I wrongfully used it for the SQLAlchemy connection not knowing the version we had was deprecated (the non-depecrated version ismysql-connector-python
.).Solution: Remove the
mysql-connector
dependency and usemysqlclient
instead, which is the client we use for the non-SQLAlchemy database connection.P.S. 1: I manually recreated my virtual environment to make sure the dependency was completely removed, but it was detected by git, so I added the directory the gitignore, I have no idea why it was ignored before.
P.S. 2 : Some whitespace auto-trimming, ignore whitespaces in review.
P.S. 3 : Added
quote()
to escape the username and password of the use (the database and host should not have special characters).Notes for existing projects
mysql-connector
viapip uninstall mysql-connector