From fcff03431b3ce72987c94531ab08f13dc13881e7 Mon Sep 17 00:00:00 2001 From: erik_ritter Date: Fri, 25 Sep 2020 14:21:48 -0700 Subject: [PATCH] feat: improve presto query perf --- superset/db_engine_specs/presto.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py index 44f867058c319..ef5a8a3d1dd08 100644 --- a/superset/db_engine_specs/presto.py +++ b/superset/db_engine_specs/presto.py @@ -730,10 +730,10 @@ def extra_table_metadata( ) if not latest_parts: - latest_parts = tuple([None] * len(col_names)) # type: ignore + latest_parts = tuple([None] * len(col_names)) metadata["partitions"] = { "cols": cols, - "latest": dict(zip(col_names, latest_parts)), # type: ignore + "latest": dict(zip(col_names, latest_parts)), "partitionQuery": pql, } @@ -925,6 +925,7 @@ def _latest_partition_from_df(cls, df: pd.DataFrame) -> Optional[List[str]]: return None @classmethod + @cache.memoize(timeout=60) def latest_partition( cls, table_name: str,