Skip to content
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

test(python): Fix version bifurcation for test_read_database_cx_credentials #18220

Merged
merged 1 commit into from
Aug 15, 2024

Conversation

mcrumiller
Copy link
Contributor

@mcrumiller mcrumiller commented Aug 15, 2024

Closes #18218. Bifurcation occurs at 3.9.5, see the following for version evidence:

3.9.4
mcrumiller@Saline-PC:~/projects/polars/py-polars$ pyenv global 3.9.4
mcrumiller@Saline-PC:~/projects/polars/py-polars$ python
Python 3.9.4 (default, Aug 15 2024, 12:38:05) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars as pl
>>> uri = "fakedb://123:456@account/database/schema?warehouse=warehouse&role=role"
>>> pl.read_database_uri("SELECT * FROM data", uri=uri, engine="connectorx")
thread '<unnamed>' panicked at 'not implemented: Connection: fakedb://123:456@account/database/schema?warehouse=warehouse&role=role not supported!', /__w/connector-x/connector-x/connectorx/src/source_router.rs:80:18
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/_utils.py", line 54, in _read_sql_connectorx
    tbl = cx.read_sql(
  File "/home/mcrumiller/.pyenv/versions/3.9.4/lib/python3.9/site-packages/connectorx/__init__.py", line 257, in read_sql
    result = _read_sql(
pyo3_runtime.PanicException: not implemented: Connection: fakedb://123:456@account/database/schema?warehouse=warehouse&role=role not supported!

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/functions.py", line 395, in read_database_uri
    return _read_sql_connectorx(
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/_utils.py", line 66, in _read_sql_connectorx
    raise type(err)(errmsg) from err
pyo3_runtime.PanicException: not implemented: Connection: fakedb://***:***@account/database/schema?warehouse=warehouse&role=role not supported!
3.9.5
mcrumiller@Saline-PC:~/projects/polars/py-polars$ pyenv global 3.9.5
mcrumiller@Saline-PC:~/projects/polars/py-polars$ python
Python 3.9.5 (default, Aug 15 2024, 12:39:57) 
[GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import polars as pl
>>> uri = "fakedb://123:456@account/database/schema?warehouse=warehouse&role=role"
>>> pl.read_database_uri("SELECT * FROM data", uri=uri, engine="connectorx")
Traceback (most recent call last):
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/_utils.py", line 54, in _read_sql_connectorx
    tbl = cx.read_sql(
  File "/home/mcrumiller/.pyenv/versions/3.9.5/lib/python3.9/site-packages/connectorx/__init__.py", line 386, in read_sql
    result = _read_sql(
RuntimeError: Source Unknown not supported.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/functions.py", line 395, in read_database_uri
    return _read_sql_connectorx(
  File "/home/mcrumiller/projects/polars/py-polars/polars/io/database/_utils.py", line 66, in _read_sql_connectorx
    raise type(err)(errmsg) from err
RuntimeError: Source Unknown not supported.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars labels Aug 15, 2024
@alexander-beedie
Copy link
Collaborator

I imagine we did this to match CI rather than pinning down the exact minor version 😅
Nice work getting to the exact version!

@alexander-beedie alexander-beedie merged commit a739825 into pola-rs:main Aug 15, 2024
13 of 15 checks passed
@mcrumiller mcrumiller deleted the test-read-db-version branch August 15, 2024 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

test_read_database_cx_credentials expected exception does not bifurcate over correct Python version
2 participants