-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
read_database
fails to parse the URI with a question mark in the password
#12645
Comments
Try putting a \ in front of the ? |
Yeah this can happen. https://docs.python.org/3/library/urllib.parse.html?highlight=quote#urllib.parse.quote_plus |
Thanks for the workarounds! |
I think manually escaping the pw is no future proof solution but using my linked method should work fine. |
Not all databases have the same connection string syntax and the focus is on making the queries work better rather than making connections string builders. Once they make simple connection string builders then every option is fair game for someone to ask for. Better to just leave it to the user or maybe a different library, maybe sqlalchemy can make a connection without doing anything else. I don't know. |
@stinodego should this be closed or just turned into a feature request? |
I'd like to phone a friend on this one. @alexander-beedie what's your take on this? |
I think @deanm0000 is right; SQLAlchemy supports only itself - we support multiple engines/backends, and I agree that we don't want to get into the business of taking connection strings, parsing them, working out which specific rules apply for the given engine/backend combination, escaping accordingly, and then recombining them and handing off. The caller should know what is valid, and provide it in the correct form. We should also probably assume that there are plenty of people already escaping their password correctly. If we now start applying quoting rules we will break them. Clearly documenting that you are expected to supply a valid connection string "ready for use" when passed into the given engine is a good move, and I think that's sufficient 👍 |
Thanks Alex! Right, so we'll accept a PR that improves the documentation on this, but we will not support it. I'll mark this as accepted. |
This issue does not impact when using polars 0.18.11 with connectorx 0.3.2a7 |
Checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
Log output
Issue description
pl.read_database
started failing after the password inside the URI string got changed. It now contains a question mark symbol -?
.sqlalchemy
is able to use this string correctly, butpolars
fails to parse it.Expected behavior
Question marks should not break URI parsing
Installed versions
The text was updated successfully, but these errors were encountered: