[sqlite] time grain isn't set properly
Make sure these boxes are checked before submitting your issue - thank you!
- [x ] I have checked the superset logs for python stacktraces and included it here as text if 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
Superset version
0.20.4
Expected results
When editing a bar graph slice, specify a time grain of "week" X-axis of the bar graph runs on a weekly interval
The same would be true of "month" granularity
Actual results
When editing a bar graph slice, specify a time grain of "week" X-axis of the bar graph remains on a daily interval
The same is true of "month" granularity
Steps to reproduce
Specify a time grain of "week" for a bar graph slice Run Query in slice editor or save slice and view dashboard
I tried manually editing the "time_grain_sqla" parameter in the slice editor to be set to "week," it caused no effect.
Please open bugs only against latest release. A lot has been fixed since 0.19.0
OK. Can you let me know if this has been fixed in subsequent releases or point me to documentation that would provide this info?
Sorry, but the burden on verifying it's fixed or not is on you. The point of reproducing with latest release is not to waste time to research stuff that may be already be fixed :)
Let me rephrase the second part of my post: where are the release notes?
I upgraded Superset and the problem still persists.
I upgraded Superset and the problem still persists. The x-axis does not change granularity as I adjust the time grain in the slice.
Is this the "Time Series - Bar Chart" or the "Distribution - Bar Chart" ?
Time Series - Bar Chart
Which database backend is this?
SQLite 3
On Mon, Nov 6, 2017 at 10:05 AM, Maxime Beauchemin <[email protected]
wrote:
Which database backend is this?
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-superset/issues/3746#issuecomment-342063181, or mute the thread https://github.com/notifications/unsubscribe-auth/Afh_uIhkkXaB6Ax7kFV9rhFcfhc79ikAks5szq-fgaJpZM4QMSP3 .
I can't reproduce with the example data...
do you want to get on a Google hangout or something so I can show you what I'm seeing? or I can send screenshots
On Mon, Nov 6, 2017 at 10:08 AM, Maxime Beauchemin <[email protected]
wrote:
I can't reproduce with the example data...
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-superset/issues/3746#issuecomment-342063738, or mute the thread https://github.com/notifications/unsubscribe-auth/Afh_uKHLuBAa6R6dFEmqL6Z5-esj1996ks5szrB4gaJpZM4QMSP3 .
Daily time grain: [image: Inline image 1]
Weekly time grain (I clicked Run Query to update it): [image: Inline image 2]
I want to see the data aggregated for each week
On Mon, Nov 6, 2017 at 10:21 AM, Clay Crosby [email protected] wrote:
do you want to get on a Google hangout or something so I can show you what I'm seeing? or I can send screenshots
On Mon, Nov 6, 2017 at 10:08 AM, Maxime Beauchemin < [email protected]> wrote:
I can't reproduce with the example data...
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-superset/issues/3746#issuecomment-342063738, or mute the thread https://github.com/notifications/unsubscribe-auth/Afh_uKHLuBAa6R6dFEmqL6Z5-esj1996ks5szrB4gaJpZM4QMSP3 .
Get the same error. Checked the SQL and it seems that the parameter for strftime is set incorrectly all the time.
Weekly:
SELECT DATE(cancel_time, -strftime('%%w', cancel_time) || ' days') AS __timestamp,
COUNT(ordernumber) AS count
FROM canc_reasons
WHERE cancel_time >= '2017-11-07 00:00:00.000000'
AND cancel_time <= '2017-11-14 20:17:56.000000'
GROUP BY DATE(cancel_time, -strftime('%%w', cancel_time) || ' days')
ORDER BY count DESC
LIMIT 50000
OFFSET 0
Monthly:
SELECT DATE(cancel_time, -strftime('%%d', cancel_time) || ' days', '+1 day') AS __timestamp,
COUNT(ordernumber) AS count
FROM canc_reasons
WHERE cancel_time >= '2017-11-07 00:00:00.000000'
AND cancel_time <= '2017-11-14 20:20:18.000000'
GROUP BY DATE(cancel_time, -strftime('%%d', cancel_time) || ' days', '+1 day')
ORDER BY count DESC
LIMIT 50000
OFFSET 0
Here's where it's defined in the source if someone wants to tackle this. https://github.com/apache/incubator-superset/blob/master/superset/db_engine_specs.py#L296
Same issue for Clickhouse data source on version 0.22.1
SELECT toStartOfMinute(toDateTime(dt)) AS __timestamp, COUNT(*) AS number_of_requests FROM abc WHERE DateReceived >= toDateTime('2018-02-24 00:00:00') AND DateReceived <= toDateTime('2018-02-24 23:59:59') AND dt >= toDate('2018-02-24') AND dt <= toDate('2018-02-24') GROUP BY toStartOfMinute(toDateTime(dt)) ORDER BY number_of_requests DESC LIMIT 5000
Attn: @claycrosby @jkokatjuhha I am unable to to replicate this bug; have you tested against a fresh version? If it's still present I can work on this issue if someone can help me reproduce the problem.
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.