superset icon indicating copy to clipboard operation
superset copied to clipboard

Today's data is missing when filtering last x days

Open SaitejaP opened this issue 7 years ago • 3 comments

The where clause takes max time till today's 0th hour thereby ignoring entries for today.

Expected results

When I select last 7 days, the where clause is expected to be WHERE updated_at >= '2019-09-25 00:00:00' AND updated_at <= now()

Actual results

WHERE updated_at >= '2019-09-25 00:00:00' AND updated_at <= '2019-10-02 00:00:00'

Today is 2nd Oct

Screenshots

image image

How to reproduce the bug

  1. Go to 'create a new chart'.
  2. Select any datasource, choose Line Chart as visualization type and create a new chart.
  3. Select any datetime column for time column, day as time grain, Last Week as time range.
  4. Run query.
  5. Click on view query to see the error.

Environment

  • superset version: 0.34.0
  • python version: 3.6.4
  • node.js version: 4.8.2
  • npm version: not sure

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.

SaitejaP avatar Oct 02 '19 03:10 SaitejaP

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.92. Please mark this comment with :thumbsup: or :thumbsdown: to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

issue-label-bot[bot] avatar Oct 02 '19 03:10 issue-label-bot[bot]

You can define how today is handled by default in superset_config.py (check the defaults in superset/config.py). You can also write now in the to-field to make it reference the current time instead of midnight.

villebro avatar Oct 02 '19 20:10 villebro

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[bot] avatar Dec 01 '19 20:12 stale[bot]