mirror of
https://github.com/apache/superset.git
synced 2026-05-28 11:15:24 +00:00
Fixes
This commit is contained in:
@@ -69,6 +69,7 @@ class QueryCacheManager:
|
||||
cache_value: dict[str, Any] | None = None,
|
||||
sql_rowcount: int | None = None,
|
||||
queried_dttm: str | None = None,
|
||||
semantic_cache_hit: bool | None = None,
|
||||
) -> None:
|
||||
self.df = df
|
||||
self.query = query
|
||||
@@ -86,6 +87,7 @@ class QueryCacheManager:
|
||||
self.cache_value = cache_value
|
||||
self.sql_rowcount = sql_rowcount
|
||||
self.queried_dttm = queried_dttm
|
||||
self.semantic_cache_hit = semantic_cache_hit
|
||||
|
||||
# pylint: disable=too-many-arguments
|
||||
def set_query_result(
|
||||
@@ -110,6 +112,7 @@ class QueryCacheManager:
|
||||
self.error_message = query_result.error_message
|
||||
self.df = query_result.df
|
||||
self.sql_rowcount = query_result.sql_rowcount
|
||||
self.semantic_cache_hit = query_result.semantic_cache_hit
|
||||
self.annotation_data = {} if annotation_data is None else annotation_data
|
||||
self.queried_dttm = (
|
||||
datetime.now(tz=timezone.utc).replace(microsecond=0).isoformat()
|
||||
@@ -131,6 +134,7 @@ class QueryCacheManager:
|
||||
"rejected_filter_columns": self.rejected_filter_columns,
|
||||
"annotation_data": self.annotation_data,
|
||||
"sql_rowcount": self.sql_rowcount,
|
||||
"semantic_cache_hit": self.semantic_cache_hit,
|
||||
"queried_dttm": self.queried_dttm,
|
||||
"dttm": self.queried_dttm, # Backwards compatibility
|
||||
}
|
||||
@@ -186,6 +190,9 @@ class QueryCacheManager:
|
||||
query_cache.is_loaded = True
|
||||
query_cache.is_cached = cache_value is not None
|
||||
query_cache.sql_rowcount = cache_value.get("sql_rowcount", None)
|
||||
query_cache.semantic_cache_hit = cache_value.get(
|
||||
"semantic_cache_hit", None
|
||||
)
|
||||
query_cache.cache_dttm = (
|
||||
cache_value["dttm"] if cache_value is not None else None
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user