-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[Dataset][Time filter] Allow setting a global or dataset-level default time range #13125
Comments
I agree with this change - setting time range filter at the dataset-level. the reason we set filter to default "Last week" is to prevent users from running expensive explorational query. Not sure about changing default to"No filter" though, shouldn't we allow user to set default? or similar to ad-hoc filter, store value in local storage as user's own default? |
#12542 related |
@junlincc the idea IS to allow users to set default. I was just proposing we don't set the initial default. Once the global setting for default time filter is added, Superset may ship with the global config as "No filter" because it is the most neutral choice. It also forces organizations to pick a default value that makes the most sense to them. We could also just focus on Dataset level settings and maybe make the default time range filter a required field when creating a new dataset. (Updated the issue description to reflect these clarifications.) |
@ktmud |
I think remembering users' last selected time filter MAY work, but it doesn't solve the problem of the initial default "last week" not making sense to certain datasets (i.e. those who don't update every week). We still need a dataset-level default. We can drop the idea of making it a required field as I imagine it'd be quite hard to implement a good UX for it---especially considering most virtual datasets are created from SQL Lab. Whether the global initial default is "Last week" or "No filter" is debatable, but I guess it doesn't matter much as long as there is a way to change it in Superset configs. |
what about setting [max date -7, max date) of any dataset by default? @ktmud |
That's a great idea, but I'm not sure how easy it is implement, though--both engineering and design-wise. We need a clean design to communicate this default value to users clearly, and it needs to be performant (which means there has to be some kind of cache, you can't just query what is the min/max date on the fly). |
engineering wise, shouldn't be too hard. and if min and max dates in dataset can be detected, do we still need any configuration? |
I like the idea of being able to define a global default time range in |
@junlincc It's not easy engineering wise. |
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 |
Related to issue apache#13125 First change to complete apache#13125: We add a new configuration `DEFAULT_TIME_FILTER` to allow admins to set a global deafult time filter for any explore charts. By default this is set to `None`, which replicates the previous behavior. To get a default filter of -1w the configuration can be set to `'Last week'`. There is a minor change in behavior `UPDATE_FORM_DATA_BY_DATASOURCE`, the time filter is not reset anymore (the time dimension does still). This is similar to the behavior of other globally configured filters such as the row limit for explore.
I was thinking about trying my luck with database and dataset overrides for the new global default time filter (#21879). Is this still something people are interested in, or have there been any inklings to go a different route? |
Thanks to everyone who has contributed to the discussion. Closing this issue as it seems this should be accounted for in most recent versions of Superset. |
Is your feature request related to a problem? Please describe.
Currently new charts are created with the default time range filter value set to "Last week". This may make sense for some businesses, but often cause confusion when users didn't notice this filter is being implicitly applied. Experienced users may even have learned the first thing they do when creating a new chart is to reset this to
No filter
(or whatever is the best for their dataset).Describe the solution you'd like
It would be ideal if we can provide a global, as well as database and dataset-level settings on the default Time Range filter when creating a new chart. For dataset-level configuration, we may even allow it to be configurable for each datetime column.
We can start simple with global level configuration that each business can adjust for their own needs. In the future, in the spirit of doing less implicit things, we should probably also consider setting the default global config to "No filter".
Or we can focus on implementing the dataset level config, and set it as "Last week" for all existing datasets.
Describe alternatives you've considered
Simply changing the default to "No filter" may not be desired because time filters have impact on the performance of db queries and setting "No filter" as global default may cause undesired long running queries, especially when a chart start running new queries right after creation (e.g. table chart).
Additional context
Ref: #13109 (comment)
The text was updated successfully, but these errors were encountered: