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

Can't create chart if write incorrect SQL request in virtual dataset #30586

Open
3 tasks done
PavelOreshkin opened this issue Oct 11, 2024 · 1 comment
Open
3 tasks done

Comments

@PavelOreshkin
Copy link

Bug description

Can't create chart if write incorrect SQL request in virtual dataset

Steps:

  1. Create dataset
  2. Go to dataset list
  3. Click on Edit icon on this new dataset
  4. Click on icon Lock with text "Click the lock to make changes."
  5. Choose Virtual
  6. In SQL textarea write "SELECT 1"
  7. Click on Save
  8. Enter on this dataset
  9. Choose any column in "Dimensions" selector
  10. Click "Create chart"

Actual results:
Import error is shown in the "Connect a database" dialog

Expected behavior:
May be validate dataset SQL before starting work with chart or let the user select only those columns that he can select

Screenshots/recordings

image

Superset version

master / latest-dev

Python version

3.9

Node version

16

Browser

Chrome

Additional context

No response

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.
Copy link

dosubot bot commented Oct 11, 2024

Hey @PavelOreshkin! I'm here to help you with any bugs, questions, or contributions you have for Apache Superset. Let's tackle this issue together!

I found a similar closed issue regarding filtering based on virtual columns. The solution suggested was to add the column to the dataset via the dataset editor, which resolves the issue. However, this might not be practical for many columns, and ideally, the query should work without manually adding each column [1].

For your specific issue, it seems like validating the SQL in the virtual dataset before proceeding with chart creation could prevent such errors. Ensuring that the SQL query is correct and that all necessary columns are present in the dataset might help avoid import errors during chart creation.

To continue talking to Dosu, mention @dosu.

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

1 participant