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

A value is required for bind parameter '1' #971

Open
tekumara opened this issue Dec 30, 2023 · 1 comment
Open

A value is required for bind parameter '1' #971

tekumara opened this issue Dec 30, 2023 · 1 comment

Comments

@tekumara
Copy link

tekumara commented Dec 30, 2023

What happens?

RuntimeError: (sqlalchemy.exc.InvalidRequestError) A value is required for bind parameter '1'
[SQL: select json('[{"a"?}, {"b"?}]')]

but when run in the duckdb cli the result is:

❯ duckdb
v0.9.2 3c695d7ba9
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
D select json('[{"a":1}, {"b":2}]');
┌────────────────────────────┐
│ json('[{"a":1}, {"b":2}]') │
│            json            │
├────────────────────────────┤
│ [{"a":1},{"b":2}]          │
└────────────────────────────┘

To Reproduce

%load_ext sql
%config SqlMagic.feedback = False
%config SqlMagic.displaycon = False
%config SqlMagic.autopandas = True
%sql duckdb:///:memory:
%sql select json('[{"a":1}, {"b":2}]')

OS:

macos

JupySQL Version:

0.10.7

Full Name:

Oliver Mannion

Affiliation:

Xero

@edublancas
Copy link

thanks for reporting this! this is related to #972, we can create a new option to disable parameter expansion because :1 is interpreted as a query parameter.

as a quick fix: adding a space (eg : 1) might fix the issue

@bryannho bryannho mentioned this issue Jan 12, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants