database names with "$" in name converted to "%24" in connection string #18271
Unanswered
beautah
asked this question in
Q&A / Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a several mySQL databases with the naming convention:
<user>$<device>
. When querying the connection seems to fail often, seemingly with different behavior for different methods called. It was apparent from the error message that the database name was being mutated to<user>%24<device>
. Its a simple enough fix to use the following mutator function in the superset_config.py to fix this:But given "$" is a valid character in a mySQL database's name it seems to me that this should work "out of the box" so to speak. Again, easy fix but seems like a bug. Excellent choice to make the DB_CONNECTION_MUTATOR available in the config, not sure if that's borrowed from another library, but its a slick way to get the job done.
Expected results
I expect the connection string to keep the name of the database correct, even with a "$". Or conversely convert the url encoding back to the original before passing it to sqlalchemy's create_engine
Actual results
It's obviously converting to a url safe string, I'm guessing urllib.parse? Any "$" gets converted to "%24"
Screenshots
None... the error had something to do with invalid credentials, but in reality the database it was looking for doesn't exist
How to reproduce the bug
Create a database with a "$" in the name of the database, mySQL in particular. Then try to connect in SQLab
Environment
1.0
3.8
unknown
Checklist
Additional context
This is no biggie, easily solved with a provided methodology (mutate the connection), but given its a valid use case I wanted to make the devs aware. Sorry no logs, they have since been deleted after I fixed and I'd rather not revert just to get the exact error message/traceback.
Beta Was this translation helpful? Give feedback.
All reactions