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

Unable to detect valid SELECT statement #29448

Open
3 tasks done
michael-s-molina opened this issue Jul 1, 2024 · 1 comment
Open
3 tasks done

Unable to detect valid SELECT statement #29448

michael-s-molina opened this issue Jul 1, 2024 · 1 comment
Assignees
Labels
sqllab Namespace | Anything related to the SQL Lab

Comments

@michael-s-molina
Copy link
Member

michael-s-molina commented Jul 1, 2024

Bug description

Our query parser is unable to detect the following valid SELECT statement:

WITH my_table AS (
  SELECT
    *
  FROM public.cleaned_sales_data
)
SELECT
  *
FROM my_table

On SQL Lab, it throws Only SELECT statements are allowed against this database.

How to reproduce the bug

1 - Go to SQL Lab and try to execute the query
2 - Check the error message

Screenshots/recordings

Screenshot 2024-07-01 at 17 15 36

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

The error comes from:

def is_select(self) -> bool:

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@michael-s-molina michael-s-molina changed the title Unable to detect valid SELECT clause Unable to detect valid SELECT query Jul 1, 2024
@michael-s-molina michael-s-molina changed the title Unable to detect valid SELECT query Unable to detect valid SELECT statement Jul 1, 2024
@dosubot dosubot bot added the sqllab Namespace | Anything related to the SQL Lab label Jul 1, 2024
@Habeeb556
Copy link

#28145 is related I think, as applying the sql_parse.patch resolved this error for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sqllab Namespace | Anything related to the SQL Lab
Projects
None yet
Development

No branches or pull requests

3 participants