xtinec commented on a change in pull request #6220: [SIP-5] Open a new /api/v1/query endpoint that takes query_obj URL: https://github.com/apache/incubator-superset/pull/6220#discussion_r231310438
########## File path: superset/common/query_object.py ########## @@ -0,0 +1,59 @@ +# pylint: disable=R +from typing import Dict, List, Optional, Union + +from superset import app +from superset.utils import core as utils + +# TODO: Type Metrics dictionary with TypedDict when it becomes a vanilla python type +# https://github.com/python/mypy/issues/5288 +Metric = Union[str, Dict] + + +class QueryObject: + """ + The query object's schema matches the interfaces of DB connectors like sqla + and druid. The query objects are constructed on the client. + """ + def __init__( + self, + granularity: str, + groupby: List[str], + metrics: List[Metric], + filters: List[str], + time_range: Optional[str] = None, + since: Optional[str] = None, + until: Optional[str] = None, + time_shift: Optional[str] = None, + is_timeseries: bool = False, Review comment: Yeah, I think so. We're currently setting it to different values depending on which viz it is on the server side. My thought is we'll compute this on the client and pass it in as part of the `query_object`. Thoughts? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
