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

right bracket was added after comment line if the last line of a CTE is comment #886

Closed
santasatan opened this issue Sep 17, 2023 · 2 comments · Fixed by #894
Closed

right bracket was added after comment line if the last line of a CTE is comment #886

santasatan opened this issue Sep 17, 2023 · 2 comments · Fixed by #894
Assignees

Comments

@santasatan
Copy link

santasatan commented Sep 17, 2023

What happens?

when use --save to write a query and it is happened that a comment line is added as the last line of the query, then if this query is used as a CTE (--with) in latter cell, the right bracket of the CTE query is added at the end of the comment line, which cause the program ignores the bracket when run the query and cause error

To Reproduce

cell 1

%%sql --save q1 --no-execute
select *
from xx
--thi is comment

cell 2

%%sql --with q1
select *
from t1, xx
where t1.id = xx.id 

then, when run cell 2, it seems the whole query will be translated to this and will get error

WITH q1 AS (
select *
from xx
--this is comment )                 *--here the bracket is added at the end of the comment line

select *
from t1, xx
where t1.id = xx.id 

OS:

Windows

JupySQL Version:

0.10.1

Full Name:

Santa Satan

Affiliation:

santa-satan

@edublancas
Copy link

this indeed looks like a bug. @neelasha23 please take a look

@edublancas
Copy link

@santasatan: this has been fixed in #894; I'd appreciate it if you could install jupysql from the main branch and test. If all is good, we'll release this!

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