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

Dashboard Share URL excludes Experimental Filters and Cross Filters values #16580

Open
3 tasks done
stevetracvc opened this issue Sep 3, 2021 · 6 comments
Open
3 tasks done
Assignees
Labels
#bug Bug report

Comments

@stevetracvc
Copy link
Contributor

When you share a dashboard (Copy Dashboard URL, Share dashboard by email, or click the link icon next to a tab, etc), the native filter values and deprecated filter values are exported with the shortened link. However, cross filters and the new experimental embedded filters (eg, Range Filter, Select Filter, etc) are NOT exported.

Expected results

When you share a dashboard's state with someone, you'd expect ALL parts of the state to be shared. This would include every filter's setting

Actual results

The Cross Filter-type filter values are not exported

How to reproduce the bug

  1. Add Native filters and Range Filter or Select Filter boxes to a dashboard. Also set a table to emit cross filters.
  2. Set several filter values, on Native Filters and the embedded Range Filter, as well as cross filters for a table.
  3. Click on the dashboard's three dots and choose "Copy dashboard URL"
  4. Paste this URL into a new browser tab
  5. Note that the Native Filter values are populated, but the Range Filter, Select Filter, and emitted Cross Filter values are not

Environment

  • superset version: master, as of Aug 27 (last commit was 62d8ab7)
    using the Docker version, so all other software is as-is from the Docker configs
  • any feature flags active:
    "DASHBOARD_NATIVE_FILTERS": True,
    "DASHBOARD_CROSS_FILTERS": True,
    "DASHBOARD_FILTERS_EXPERIMENTAL": True,
    "ENABLE_EXPLORE_DRAG_AND_DROP": False,
    "ENABLE_TEMPLATE_PROCESSING": True,
    "DYNAMIC_PLUGINS": True,
    "DASHBOARD_RBAC": True,

Checklist

  • I have checked the superset logs for python stacktraces and included it here as text if there are any.
  • I have reproduced the issue with at least the latest released version of superset.
  • I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

A little discussion here: https://apache-superset.slack.com/archives/C016B3LG5B4/p1629643453183200

The generated URLs are shortened, but prior to getting shortened, they're basically a bunch of URL parameters. I dug around and found that the Native Filters and old (deprecated) filter boxes are properly exported, but in file src/dashboard/actions/hydrate.js is what loads the preselect_filters and native_filters from the URL parameters. There's a section on setting up cross filters, but not loading any values for them from URL params. It also doesn't do anything for things like Range Filters.

I tried changing line 194, which only looks for "filter_box" elements, to instead include "filter_*" so that it would catch the range filters. It generated this example set of URL parameters:

preselect_filters={"998":{"COLUMN_NAME":"All"},"1104":{"ANOTHER_COLUMN_NAME":{"filters":[{"col":"ANOTHER_COLUMN_NAME","op":">=","val":93.75}]}}}&native_filters=(NATIVE_FILTER-XofC8k3la:(extraFormData:(),filterState:(),id:NATIVE_FILTER-XofC8k3la,ownState:()))
element 998 is an old-school (apparently deprecated) filter, element 1104 is a range filter (cross filter), and I had no value set for my one native filter. This link doesn't actually apply the set values to element 1104.

I might be able to fix this myself, if I get some assistance on where to look. These filters seem to apply similar to cross filters rather than native filters, so I'm guessing I need to look there.

@michael-s-molina
Copy link
Member

Back-end part to fix this: #17536

The front-end part will come next.

@stevetracvc
Copy link
Contributor Author

Awesome thanks @michael-s-molina ! So this should fix all the issues related to filter state?

What about old saved URLs? eg, our team already is using /r/156 for something. Will loading state from URL be kept long-term, or do you expect these to be deprecated and thus migrated to the new form? I would vote to NOT deprecate, as I also build links in the dashboard, to take you to another tab with filters pre-set. Eg, I have a table with data. One column is a list of names, and they're from a calculated column in the table that I built to generate a link to another dashboard, pre-filling filter values for that name. Sort of like a clunky drill-down.

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Apr 17, 2022
@simonvanderveldt
Copy link

@michael-s-molina Do you know what needs to be done for this and if any progress has been made on this?

@michael-s-molina
Copy link
Member

michael-s-molina commented Aug 26, 2022

@simonvanderveldt I think this was fixed. I'll close the issue but please reopen it if the bug still exists.

@jwdalton
Copy link

jwdalton commented Sep 8, 2024

@michael-s-molina I just tried this, and it doesn't seem to work in superset 4.0.1. Specifically, the native filter values are saved, but any selected cross filter values are not saved when creating a permalink for a dashboard.

It does look like the cross filter value is being stored in the permalink json in the key_value table when the permalink is created, so maybe the issue is how it is being applied/used when the permalink is loaded?

Would you be able to re-open this issue?

@stale stale bot removed the inactive Inactive for >= 30 days label Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
None yet
Development

No branches or pull requests

5 participants