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

Datasets are empty in SQL Lab #537

Closed
Ian2012 opened this issue Dec 4, 2023 · 5 comments
Closed

Datasets are empty in SQL Lab #537

Ian2012 opened this issue Dec 4, 2023 · 5 comments

Comments

@Ian2012
Copy link
Contributor

Ian2012 commented Dec 4, 2023

In the SQL Lab, there is no way to inject filters unless the use of raw SQL, and filter values are checked to be defined in many datasets so that the instructor dashboard makes sense.

This causes the SQL Lab and the create chart view obsolete as we can't previsualize, nor query the database there.

The solution would be to verify the current context (dashboard, chart, or sqllab) and provide a corresponding default values for the where clauses

@bmtcril
Copy link
Contributor

bmtcril commented Dec 4, 2023

Can you give a specific example of how to trigger this and what you see? There are some privacy and security considerations for granting access to data that we may have to think through or document more explicitly if non-superusers are working in SQL Lab.

@Ian2012
Copy link
Contributor Author

Ian2012 commented Dec 4, 2023

Create a chart for a dataset that requires filter values:

image
image

Check that the visualization shows no data even if it's there

@bmtcril
Copy link
Contributor

bmtcril commented Dec 4, 2023

Right, I think those are explicitly set to not load the entire dataset if no filter is selected, otherwise the query will just time out anyway on a large dataset:

{% if filter_values('video_name_with_location') != [] %} video_name_with_location in {{ filter_values('video_name_with_location') | where_in }} {% else %} 1=0 {% endif %}

They could just temporarily change that to 1=1 on whatever virtual dataset they're working on locally to get all results for testing. Running this with 1=1 on a production environment can run the server out of memory and cause performance issues, so I'd like to avoid doing that by default. Plus it has some potential security / privacy issues we'd have to work through from a product perspective about how we want to support those features for non-superusers.

I don't know of a way to use the virtual datasets in SQL Lab, but I know there's a way to pass a filter value in the "..." menu -> Parameters and _filters that should help get past some of this: https://superset.apache.org/docs/installation/sql-templating/

@bmtcril
Copy link
Contributor

bmtcril commented Jan 12, 2024

@Ian2012 is this still an issue we need to work more on, or were the suggestions sufficient?

@Ian2012
Copy link
Contributor Author

Ian2012 commented Jan 12, 2024

@bmtcril Yes, I can confirm we can close it now

@Ian2012 Ian2012 closed this as completed Jan 12, 2024
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

2 participants