Bug description
In this recently merged pulll request: https://github.com/apache/superset/pull/28312
it says that
The superset feature allows users to choose a non-temporal column for the x-axis. However, when a non-temporal column is selected, advanced analytics and forecast options are not compatible.
This not quite true. We use the Rolling Window functions extensively for our charts with non-temporal fields as the x-axis. I imagine some users might be surprised by this new behavior, as a lot of use-cases need Rolling Window functions.
As a workaround, we of course can edit the underlying Datasets. But it was a nice, accessible feature. And now it's gone. And that's sad.
As an aside: As long as we do not update the charts, they still show the desired behavior (with applied rolling window function) - we just cannot edit them :).
Detailed description of current behavior
- Go to /chart/add create new to create a new Chart
- Select one of "Line Chart", "Area Chart" or "Bar Chart"
- Add a date field as the x-Axis
- The Advanced Analytics View is shown
- Add a non-date field as the x-Axis
- The Advanced Analytics View is hidden
Screencast from 2024-11-22 08-46-17.webm
Proposed Solution
Either rollback the PR: * https://github.com/apache/superset/pull/28312
Or make the behavior configurable via a FEATURE_FLAG: * HIDE_ADVANCED_ANALYTICS_FOR_NON_TEMPORAL_X_AXIS
Thank you for considering this.
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.11
Node version
16
Browser
Chrome
Additional context
No response
Checklist
- [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [X] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
Comment From: dosubot[bot]
@qmb-jschwartz Hello there! I'm here to help you with any bugs, questions, or contributions you might have for the project. Let's work together to solve this issue.
The recent change in pull request #28312 hides the Advanced Analytics options for non-temporal x-axis fields in Apache Superset. This was done because advanced analytics and forecast options are generally not compatible with non-temporal data [1]. However, as you've noted, the Rolling Window function can still be useful for non-temporal fields.
Currently, the visibility of these options is controlled by the displayTimeRelatedControls
function, which checks if the x-axis field is temporal [2]. Unfortunately, there isn't a built-in feature flag to override this behavior or make it configurable at the moment [3].
Your suggestion to either roll back the change or introduce a feature flag like HIDE_ADVANCED_ANALYTICS_FOR_NON_TEMPORAL_X_AXIS
could be a viable solution to address this issue. This would allow users who rely on these functions for non-temporal data to continue using them without disruption.
To continue talking to Dosu, mention @dosu.
Comment From: qmb-jschwartz
Hi @justinpark, do you see a possibility to toggle this functionality (hiding of Advanced Analytics), via a feature flag? Thank you!
Comment From: rusackas
Hmmm... I haven't looked, but I wonder if there's a way to detect if the dataset has any temporal columns in it, and hide/ignore the Advanced Analytics controls if not. That'd probably be preferable to a feature flag.
Comment From: qmb-jschwartz
HI @rusackas ,
thanks for your reply and sorry for being unclear. This merged PR already does what you describe:
but I wonder if there's a way to detect if the dataset has any temporal columns in it, and hide/ignore the Advanced Analytics controls if not.
Unfortunately, I have a use-case (and suspect others might have that issue as well), where I use Advanced Analytics functionality on a non-temporal column. So this new behavior makes my use-case impossible.
Comment From: rusackas
This has been a silent thread for a long time, but probably because we don't often hear a use case for Advanced Analytics (Rolling Window or otherwise) across a categorical axist. It certainly wouldn't be applicable across a dimension of Country or Manufacturer, so I'm not sure where it is applicable. Tempted to close this as not-planned, since it's... not part of the plan, but still interested in the use case.
Comment From: qmb-jschwartz
Hi @rusackas, our use case are the cumulative sum of sold tickets in the weeks prior to an event. We "normalize" the event dates that take place at different dates within a year and also in different years and the dates of the tickets to be in brackets of weeks prior to an event date. This allows us to present a chart like this:
If we were to present this as dates, we would need an inverted timeline and an arbitrary event date, let's say 1900-01-01. I don't believe this to be possible within superset.
Even for something like you mentioned, countries or manufacturers a cumulative sum might be interesting (to see contributions to a the entire set, eg. the globe or entire market) if other dimensions are used already. For other ordered categorical values, like sentiments this might come in handy as well.
I feel that the benefit of removing this feature from the UI for non-temporal values to be very small (as it was really useful to me), but must concede that there have been no responses by others, so probably no one else used it in this way.
We've rewritten all our queries, so feel free to close the ticket.
Thanks for your time!
Comment From: rusackas
...but must concede that there have been no responses by others, so probably no one else used it in this way. We've rewritten all our queries, so feel free to close the ticket.
Thanks. We'll close it for now, but if it becomes super troublesome, the community is always open to features, docs and discussions/proposals around them, if this needs revisiting.