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

UsageError: unrecognized arguments: -> #973

Closed
tekumara opened this issue Dec 31, 2023 · 5 comments · Fixed by #974
Closed

UsageError: unrecognized arguments: -> #973

tekumara opened this issue Dec 31, 2023 · 5 comments · Fixed by #974

Comments

@tekumara
Copy link

What happens?

UsageError: unrecognized arguments: -> '$.id'

To Reproduce

%load_ext sql
%config SqlMagic.feedback = False
%config SqlMagic.displaycon = False
%config SqlMagic.autopandas = True
%sql duckdb:///:memory:
%sql SELECT json('{"id": "a"}') -> '$.id'

OS:

macos

JupySQL Version:

0.10.7

Full Name:

Oliver Mannion

Affiliation:

Xero

@tekumara tekumara changed the title @sql UsageError: unrecognized arguments: -> '$.id' %sql UsageError: unrecognized arguments: -> '$.id' Dec 31, 2023
@tekumara
Copy link
Author

tekumara commented Dec 31, 2023

Another variant using %%sql

%%sql SELECT json('{"id": "a"}') -> '$.id',
json('{"id": "b"}') -> '$.id'

produces:

UsageError: Unrecognized argument(s): ->

@tekumara tekumara changed the title %sql UsageError: unrecognized arguments: -> '$.id' UsageError: unrecognized arguments: -> Dec 31, 2023
@tekumara
Copy link
Author

Similar to #918

@tekumara
Copy link
Author

Workaround:

%%sql
SELECT json('{"id": "a"}') -> '$.id',
json('{"id": "b"}') -> '$.id'

@edublancas
Copy link

@bryannho can you take a look? I thought that the fix you implemented which used SQL keywords to detect where the query begins should address this

@bryannho
Copy link

bryannho commented Jan 2, 2024

@edublancas yes, this should have been caught! looking into it now

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

Successfully merging a pull request may close this issue.

3 participants