mirror of
https://github.com/apache/superset.git
synced 2026-04-20 08:34:37 +00:00
fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 [ID-7] (#17287)
* fix(dashboard): Return columns and verbose_map for groupby values of Pivot Table v2 * Refactor * Fix test and lint * Fix test * Refactor * Fix lint
This commit is contained in:
committed by
GitHub
parent
ab1fcf3068
commit
fa51b3234e
@@ -40,6 +40,7 @@ from superset.utils.urls import get_url_path
|
||||
from superset.viz import BaseViz, viz_types
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from superset.common.query_context import QueryContext
|
||||
from superset.connectors.base.models import BaseDatasource
|
||||
|
||||
metadata = Model.metadata # pylint: disable=no-member
|
||||
@@ -247,6 +248,18 @@ class Slice( # pylint: disable=too-many-public-methods
|
||||
update_time_range(form_data)
|
||||
return form_data
|
||||
|
||||
def get_query_context(self) -> Optional["QueryContext"]:
|
||||
# pylint: disable=import-outside-toplevel
|
||||
from superset.common.query_context import QueryContext
|
||||
|
||||
if self.query_context:
|
||||
try:
|
||||
return QueryContext(**json.loads(self.query_context))
|
||||
except json.decoder.JSONDecodeError as ex:
|
||||
logger.error("Malformed json in slice's query context", exc_info=True)
|
||||
logger.exception(ex)
|
||||
return None
|
||||
|
||||
def get_explore_url(
|
||||
self,
|
||||
base_url: str = "/superset/explore",
|
||||
|
||||
Reference in New Issue
Block a user