-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Superset Dashboard with native filter does not correctly update when opened #27787
Comments
Here is a response from a Apache Superset PMC member:
|
It may also be worth noting that when you configure dashboard filters, you can set default values, and these are automatically applied. That may or may not help, depending on your use case. |
I got the automatic filtering solved. I found the problem. It was sitting before the keyboard. In the URL I was using the wrong value for the parameter. When applying the second "name" tag from the "targets" section as the filtering works as expected, see the screenshot below. The code from the article Apache Superset — Use URL to filter dashboards works exactly as I need it now.
|
And it applies automatically? Does that effectively close this issue? |
Bug description
Hello Superset team
I have a dashboard with native filters on two dimensions ComId and Country that I access via the following URL:
http://xxx.com/dashboard/74/?standalone=2&native_filters=(NATIVE_FILTER-4muGsWvuM:(cache:(label:%27fr%27,validateStatus:!f,value:!(%27fr%27)),extraFormData:(filters:!((col:country,op:IN,val:!(%27fr%27)))),filterState:(label:%27fr%27,validateStatus:!f,value:!(%27fr%27)),id:NATIVE_FILTER-4muGsWvuM,ownState:()),NATIVE_FILTER-mV48ONcz5:(cache:(label:%27100565400%27,validateStatus:!f,value:!(%27100565400%27)),extraFormData:(filters:!((col:merchant_id,op:IN,val:!(%27100565400%27)))),filterState:(label:%27100565400%27,validateStatus:!f,value:!(%27100565400%27)),id:NATIVE_FILTER-mV48ONcz5,ownState:()))
The dashboard open corretly, the filters are correctly set on the left side of the screen, but the filters are not applied to the data. I need to click on "Apply Filters" to have the correct view.
Step 1 - All panels load
![Step 1 - all panels load](https://private-user-images.githubusercontent.com/7863984/318079605-b9bd3961-458b-4149-8c02-78f8eda747c9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MDA1MTYsIm5iZiI6MTcxOTcwMDIxNiwicGF0aCI6Ii83ODYzOTg0LzMxODA3OTYwNS1iOWJkMzk2MS00NThiLTQxNDktOGMwMi03OGY4ZWRhNzQ3YzkucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMjIzMDE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OTMwMzA2YjQzMzY2YjRkM2QxMmE4MzQ2MGJjYTY1YWEzNWZhZTEwM2VmN2MxOTRiYTA1MzYzOTM1ZGY2MTJkMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Oo0NkzO7e0ZQ-IJXukZ2XLUPEZn04OXM6F70xbpz58U)
Step 2 - Unfiltered data loads
![Step 2 - unfiltered data loads](https://private-user-images.githubusercontent.com/7863984/318079611-c507b2ad-f588-412e-847c-56f1a4cbf5bd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MDA1MTYsIm5iZiI6MTcxOTcwMDIxNiwicGF0aCI6Ii83ODYzOTg0LzMxODA3OTYxMS1jNTA3YjJhZC1mNTg4LTQxMmUtODQ3Yy01NmYxYTRjYmY1YmQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMjIzMDE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDg1ZGE4MzA2NzIxMWI5ODUzYjllNTIyYThjYmRiNWQ2NWM1ZWNlZWY2ZjljMWU5NmE1MGEyYmVlNzgzYWM3NiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.E2fquvXbtfhW7iVp1I-Othg6k4GsCOJZHvi7o2Q1sAU)
Step 3 - Filters load on the left side
![Step3 - Filters load](https://private-user-images.githubusercontent.com/7863984/318079610-9774fed7-21a2-499f-8f29-c2c5289511b7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MDA1MTYsIm5iZiI6MTcxOTcwMDIxNiwicGF0aCI6Ii83ODYzOTg0LzMxODA3OTYxMC05Nzc0ZmVkNy0yMWEyLTQ5OWYtOGYyOS1jMmM1Mjg5NTExYjcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMjIzMDE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTMyZTZiM2U4YjY2ODMzNjdiMGIwYjEzNTRlZTQzNjE5ZTgyODg0YWRkMjAxNzI5OGVlYmMxMDk4MjMyZDM5YSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.v1_TyM070bxg9w93Sf-f5ZJnw2C3bpjZcU2rwfOarQM)
Step 4 - Correct view after clicking on Apply Filters
![Step 4 - Correct view after clicking on Apply Filters](https://private-user-images.githubusercontent.com/7863984/318079608-a9ddc20e-bf7c-4702-8cc0-a6dee65c02ee.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk3MDA1MTYsIm5iZiI6MTcxOTcwMDIxNiwicGF0aCI6Ii83ODYzOTg0LzMxODA3OTYwOC1hOWRkYzIwZS1iZjdjLTQ3MDItOGNjMC1hNmRlZTY1YzAyZWUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDYyOSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA2MjlUMjIzMDE2WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZjhhOTUyYWQyMjM1N2U1M2RkODVhNjg1NDRiNGRhMjQ5M2ZjZDQxZDZlNGNjZGNjNmJiYTYwYTEyMWYzNWExYiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.Pf955j0C9wkrHOW70Kz1yr8oDZEKs6mN0izCWKQuJg0)
I believe it is due to the fact the unfiltered data is first loaded and then the filters are set in the dropdown.
I tried to use Jinja templating in my queries to force loading the filtered data but in that case i get an error, as the filters are not set hence my Jinja templates are empty.
Is there a way to autorefresh the dashboard after the filters are set to get the filtered view right away, or another work around ?
Tested on Superset 2 and 3
Thanks in advance
How to reproduce the bug
Open a dashboard with native filters
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: