mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
viz: cache datetime.now() in query_obj (#955)
It shouldn't be a big deal, and it's pretty cheap on linux, but still :)
This commit is contained in:
parent
061d4f1ac7
commit
cc058e5c9e
@ -224,8 +224,9 @@ class BaseViz(object):
|
|||||||
form_data.get("row_limit", config.get("ROW_LIMIT")))
|
form_data.get("row_limit", config.get("ROW_LIMIT")))
|
||||||
since = form_data.get("since", "1 year ago")
|
since = form_data.get("since", "1 year ago")
|
||||||
from_dttm = utils.parse_human_datetime(since)
|
from_dttm = utils.parse_human_datetime(since)
|
||||||
if from_dttm > datetime.now():
|
now = datetime.now()
|
||||||
from_dttm = datetime.now() - (from_dttm-datetime.now())
|
if from_dttm > now:
|
||||||
|
from_dttm = now - (from_dttm - now)
|
||||||
until = form_data.get("until", "now")
|
until = form_data.get("until", "now")
|
||||||
to_dttm = utils.parse_human_datetime(until)
|
to_dttm = utils.parse_human_datetime(until)
|
||||||
if from_dttm > to_dttm:
|
if from_dttm > to_dttm:
|
||||||
|
Loading…
Reference in New Issue
Block a user