mirror of https://github.com/apache/superset.git
Fix overload issue during dashboard export to Excel
This commit is contained in:
parent
fc9bc175e6
commit
35b1902d4a
|
@ -47,6 +47,7 @@ class QueryContextFactory: # pylint: disable=too-few-public-methods
|
|||
def create( # pylint: disable=too-many-arguments
|
||||
self,
|
||||
*,
|
||||
slice: Slice | None = None,
|
||||
datasource: DatasourceDict,
|
||||
queries: list[dict[str, Any]],
|
||||
form_data: dict[str, Any] | None = None,
|
||||
|
@ -60,7 +61,9 @@ class QueryContextFactory: # pylint: disable=too-few-public-methods
|
|||
datasource_model_instance = self._convert_to_model(datasource)
|
||||
|
||||
slice_ = None
|
||||
if form_data and form_data.get("slice_id") is not None:
|
||||
if slice:
|
||||
slice_ = slice
|
||||
elif form_data and form_data.get("slice_id") is not None:
|
||||
slice_ = self._get_slice(form_data.get("slice_id"))
|
||||
|
||||
result_type = result_type or ChartDataResultType.FULL
|
||||
|
|
|
@ -285,7 +285,7 @@ class Slice( # pylint: disable=too-many-public-methods
|
|||
def get_query_context(self) -> QueryContext | None:
|
||||
if self.query_context:
|
||||
try:
|
||||
return self.get_query_context_factory().create(
|
||||
return self.get_query_context_factory().create(slice=self,
|
||||
**json.loads(self.query_context)
|
||||
)
|
||||
except json.JSONDecodeError as ex:
|
||||
|
|
Loading…
Reference in New Issue