Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: for series limit comparison on explore with chart = Query #20989

Merged
merged 2 commits into from
Aug 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions superset/common/query_context_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
)
from superset.extensions import cache_manager, security_manager
from superset.models.helpers import QueryResult
from superset.models.sql_lab import Query
from superset.utils import csv
from superset.utils.cache import generate_cache_key, set_and_log_cache
from superset.utils.core import (
Expand Down Expand Up @@ -185,10 +186,6 @@ def get_query_result(self, query_object: QueryObject) -> QueryResult:
# a valid assumption for current setting. In the long term, we may
# support multiple queries from different data sources.

# The datasource here can be different backend but the interface is common
# pylint: disable=import-outside-toplevel
from superset.models.sql_lab import Query

query = ""
if isinstance(query_context.datasource, Query):
# todo(hugh): add logic to manage all sip68 models here
Expand Down Expand Up @@ -248,7 +245,7 @@ def normalize_df(self, df: pd.DataFrame, query_object: QueryObject) -> pd.DataFr

return df

def processing_time_offsets( # pylint: disable=too-many-locals
def processing_time_offsets( # pylint: disable=too-many-locals,too-many-statements
self,
df: pd.DataFrame,
query_object: QueryObject,
Expand Down Expand Up @@ -307,7 +304,11 @@ def processing_time_offsets( # pylint: disable=too-many-locals
}
join_keys = [col for col in df.columns if col not in metrics_mapping.keys()]

result = self._qc_datasource.query(query_object_clone_dct)
if isinstance(self._qc_datasource, Query):
result = self._qc_datasource.exc_query(query_object_clone_dct)
else:
result = self._qc_datasource.query(query_object_clone_dct)

queries.append(result.query)
cache_keys.append(None)

Expand Down