mirror of
https://github.com/apache/superset.git
synced 2026-04-18 15:44:57 +00:00
refactor(plugins): BigNumber Time Comparison with existing time_offset API (#27718)
Co-authored-by: lilykuang <jialikuang@gmail.com> Co-authored-by: Kamil Gabryjelski <kamil.gabryjelski@gmail.com>
This commit is contained in:
@@ -21,7 +21,7 @@ from typing import Any, cast
|
||||
|
||||
from superset import app
|
||||
from superset.common.query_object import QueryObject
|
||||
from superset.utils.core import FilterOperator, get_xaxis_label
|
||||
from superset.utils.core import FilterOperator
|
||||
from superset.utils.date_parser import get_since_until
|
||||
|
||||
|
||||
@@ -66,10 +66,8 @@ def get_since_until_from_query_object(
|
||||
|
||||
time_range = None
|
||||
for flt in query_object.filter:
|
||||
if (
|
||||
flt.get("op") == FilterOperator.TEMPORAL_RANGE.value
|
||||
and flt.get("col") == get_xaxis_label(query_object.columns)
|
||||
and isinstance(flt.get("val"), str)
|
||||
if flt.get("op") == FilterOperator.TEMPORAL_RANGE.value and isinstance(
|
||||
flt.get("val"), str
|
||||
):
|
||||
time_range = cast(str, flt.get("val"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user