j-a-a-p opened a new issue, #24300: URL: https://github.com/apache/superset/issues/24300
In the custom fillter of the bar chart, Days get translated to Seconds. For a chart set to Seconds time grain, perhaps a line chart, this would be OK, but a chart that aggregates to a courser time grain, this will lead to faulty data. Below the screenshot of the filter. The setting is on Day level, but it can be seen already that a seconds level value will be used. '7 days before'. actually means '604,800 seconds before'. <img width="600" alt="image" src="https://github.com/apache/superset/assets/97532277/b3106167-6a98-4d04-a2c5-6be133792a0b"> In the screenshot below you can see the ramnifications. On a day-level aggregated bar chart the value of the first column is not correct. #### How to reproduce the bug 1. Creating a bar chart based on time based, transactional data set 2. Set Time Grain to Day 3. Add a Custom filter on the time, set it to between 7 days before, and Now. (See also screenshot above) 4. Bug: Notice that the first column will show a decreasing value during the course of the day. ### Expected results For a chart that is set to a certain time grain, make the filter obey this setting. Or Obey the granularity of the filter. If it is set to Days before, go back only that in days. If set in Hours, Seconds, go back to that level of granularity ### Actual results Customer filer always gets translated to the lowest granularity level. #### Screenshots Chart at 13:30. <img width="608" alt="image" src="https://github.com/apache/superset/assets/97532277/4db19c52-700f-4b2d-9c1c-ef37c1bcd403"> Same chart 2 hours later. <img width="612" alt="image" src="https://github.com/apache/superset/assets/97532277/d4729e38-3fe6-41d9-b213-3d1db92acc19"> ### Environment Mac, Chrome ### Checklist - [ ] I have checked the superset logs for python stacktraces and included it here as text if there are any. - [X] I have reproduced the issue with at least the latest released version of superset. - [X] I have checked the issue tracker for the same issue and I haven't found one similar. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
