connector-x icon indicating copy to clipboard operation
connector-x copied to clipboard

Unable to specify relative path multiple levels up for db connection

Open gaardhus opened this issue 1 year ago • 0 comments

What language are you using?

Python

What version are you using?

0.3.3

What database are you using?

sqlite

What dataframe are you using?

polars

Can you describe your bug?

When specifying a relative path as the connection string it seems to truncate some the the levels. As such pl.read_database_uri(uri="sqlite://../../app/ainterviewer.sqlite", query="SELECT * FROM conversation") doesn't work, but moving the script one level up makes pl.read_database_uri(uri="sqlite://../app/ainterviewer.sqlite", query="SELECT * FROM conversation") work. Using the other engine for polars adbc works as expected.

Example query / code
import polars as pl
pl.read_database_uri(uri="sqlite://../../app/ainterviewer.sqlite", query="SELECT * FROM conversation")

What is the error?

[2024-08-19T10:01:40Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite [2024-08-19T10:01:41Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite [2024-08-19T10:01:41Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite [2024-08-19T10:01:43Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite [2024-08-19T10:01:46Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite [2024-08-19T10:01:53Z ERROR r2d2] unable to open database file: ../app/ainterviewer.sqlite

gaardhus avatar Aug 19 '24 10:08 gaardhus