-
Notifications
You must be signed in to change notification settings - Fork 14.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
6 changed files
with
89 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
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 @@ def form_data(self) -> Dict[str, Any]: | |
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 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
if self.query_context: | ||
try: | ||
return QueryContext(**json.loads(self.query_context)) | ||
This comment has been minimized.
Sorry, something went wrong.
ofekisr
Contributor
|
||
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", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
you have added a circular dependency so it is not solid