You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently switching from using mypysql to the singlestore-python client in order to get more granular type information when inspecting tables programmatically. In this instance I am using the library with the SingleStore SQL Alchemy project.
It appears that if certain special characters specifically [ and ] are contained within the user password, then the URL parsing from urllib fails.
I've validated that if I URL encode the [ and ] values to %5B and %5D respectively, the issue still occurs even though if I test the url with urlsplit with Python on my system directly, then it can be successfully split.
I have a feeling that the call at base.py:L386 in the stack trace contains the issue, as we explicitly render the url back as a string which could undo any URL encoding that has been done upstream.
Would be grateful for a fix, thanks!
Stack Trace:
File "/home/venv/lib/python3.11/site-packages/tap_mysql/client.py", line 57, in create_engine
return sqlalchemy.create_engine(self.sqlalchemy_url, connect_args=connect_args, echo=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<string>", line 2, in create_engine
File "/home/venv/lib/python3.11/site-packages/sqlalchemy/util/deprecations.py", line 375, in warned
return fn(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^
File "/home/venv/lib/python3.11/site-packages/sqlalchemy/engine/create.py", line 560, in create_engine
(cargs, cparams) = dialect.create_connect_args(u)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venv/lib/python3.11/site-packages/sqlalchemy_singlestoredb/base.py", line 386, in create_connect_args
return [[], build_params(host=url.render_as_string(hide_password=False))]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/venv/lib/python3.11/site-packages/singlestoredb/connection.py", line 150, in build_params
urlp = _parse_url(host)
^^^^^^^^^^^^^^^^
File "/home/venv/lib/python3.11/site-packages/singlestoredb/connection.py", line 267, in _parse_url
parts = urlparse(url, scheme='singlestoredb', allow_fragments=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/cpython-3.11.6-macos-aarch64-none/lib/python3.11/urllib/parse.py", line 395, in urlparse
splitresult = urlsplit(url, scheme, allow_fragments)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/python/cpython-3.11.6-macos-aarch64-none/lib/python3.11/urllib/parse.py", line 497, in urlsplit
raise ValueError("Invalid IPv6 URL")
ValueError: Invalid IPv6 URL
The text was updated successfully, but these errors were encountered:
This is actually an issue in the SingleStore client itself. There is a fix in the main branch. If you can try that out and let me know if it fixes the problem, I can do a release. singlestore-labs/singlestoredb-python@074cb03
I am currently switching from using
mypysql
to thesinglestore-python
client in order to get more granular type information when inspecting tables programmatically. In this instance I am using the library with the SingleStore SQL Alchemy project.It appears that if certain special characters specifically
[
and]
are contained within the user password, then the URL parsing fromurllib
fails.I've validated that if I URL encode the
[
and]
values to%5B
and%5D
respectively, the issue still occurs even though if I test the url withurlsplit
with Python on my system directly, then it can be successfully split.I have a feeling that the call at
base.py:L386
in the stack trace contains the issue, as we explicitly render the url back as a string which could undo any URL encoding that has been done upstream.Would be grateful for a fix, thanks!
Stack Trace:
The text was updated successfully, but these errors were encountered: