Open PavelOreshkin opened 1 month ago
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.
If you edit the virtual query, you should probably hit the synchronize columns button to update the available columns in the chart builder tool. It's (probably?) not Superset's responsibility to pre-flight your query (which means running it, and could incur costs of any scale). While that's an interesting feature request, I'm not sure we'd consider that a bug. Curious what @betodealmeida or @villebro think. Maybe we can move this to an Ideas Discussion of we want to keep the idea rolling.
Bug description
Can't create chart if write incorrect SQL request in virtual dataset
Steps:
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
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist