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
Jupysql thinks that :NUMBER is a parameter in the query, but duckdb uses this syntax for slicing strings (just like Python), we need to fix and escape it so it works just like when we're using duckdb (I think we're already escaping some parameters so we can use that code as a reference).
I can escape manually to get it working:
but we should do the escaping automatically
Notebook:
importduckdbconn=duckdb.connect()
conn.execute("select 'hello'[:2]").fetchall()
[('he',)]
%load_extsql
%sqlduckdb://
Connecting to 'duckdb://'
Set named_parameters to False (this is actual the default so shouldn't make a difference)
%configSqlMagic.named_parameters=False
This breaks, jupysql thinks [:2] is a parameter:
%%sql
select'hello'[:2]
Running query in 'duckdb://'
RuntimeError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter '2'
[SQL: select 'hello'[?]]
[parameters: [{}]]
(Background on this error at: https://sqlalche.me/e/20/cd3x)
If you need help solving this issue, send us a message: https://ploomber.io/community
The text was updated successfully, but these errors were encountered:
Jupysql thinks that
:NUMBER
is a parameter in the query, but duckdb uses this syntax for slicing strings (just like Python), we need to fix and escape it so it works just like when we're using duckdb (I think we're already escaping some parameters so we can use that code as a reference).I can escape manually to get it working:
but we should do the escaping automatically
Notebook:
Connecting to 'duckdb://'
Set
named_parameters
to False (this is actual the default so shouldn't make a difference)This breaks, jupysql thinks
[:2]
is a parameter:Running query in 'duckdb://'
The text was updated successfully, but these errors were encountered: