This is an automated email from the ASF dual-hosted git repository.
beto pushed a commit to branch fix-query-cache
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/fix-query-cache by this push:
new 410c6b4b5b Fix style
410c6b4b5b is described below
commit 410c6b4b5bfc3d6d8cc33dfbdb69a740678c1588
Author: Beto Dealmeida <[email protected]>
AuthorDate: Tue Oct 7 16:30:22 2025 -0400
Fix style
---
superset/common/query_object.py | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/superset/common/query_object.py b/superset/common/query_object.py
index 21a22eed9b..1a9116fd2d 100644
--- a/superset/common/query_object.py
+++ b/superset/common/query_object.py
@@ -193,8 +193,7 @@ class QueryObject: # pylint:
disable=too-many-instance-attributes
return isinstance(metric, str) or is_adhoc_metric(metric)
self.metrics = metrics and [
- x if is_str_or_adhoc(x) else x["label"] # type: ignore
- for x in metrics
+ x if is_str_or_adhoc(x) else x["label"] for x in metrics # type:
ignore
]
def _set_post_processing(
@@ -362,13 +361,14 @@ class QueryObject: # pylint:
disable=too-many-instance-attributes
def _sanitize_sql_expressions(self) -> None:
"""
- Sanitize SQL expressions in adhoc metrics and orderby to ensure
- consistent cache keys. This processes SQL expressions before cache key
- generation, preventing cache mismatches due to later processing during
- query execution.
+ Sanitize SQL expressions in adhoc metrics and orderby for consistent
cache keys.
+
+ This processes SQL expressions before cache key generation, preventing
cache
+ mismatches due to later processing during query execution.
"""
if not self.datasource or not hasattr(
- self.datasource, "_process_sql_expression"
+ self.datasource,
+ "_process_sql_expression",
):
return
@@ -381,7 +381,9 @@ class QueryObject: # pylint:
disable=too-many-instance-attributes
self._sanitize_orderby_expressions()
def _sanitize_metrics_expressions(self) -> None:
- """Process SQL expressions in adhoc metrics."""
+ """
+ Process SQL expressions in adhoc metrics.
+ """
# datasource is checked in parent method, assert for type checking
assert self.datasource is not None