mirror of
https://github.com/apache/superset.git
synced 2024-09-16 02:29:39 -04:00
fix: dedup groupby in viz.py while preserving order (#10633)
This commit is contained in:
parent
cb1989a4fd
commit
82dda473b1
@ -18,15 +18,13 @@ import logging
|
||||
from io import IOBase
|
||||
from typing import cast, Optional, Union
|
||||
|
||||
from flask import current_app
|
||||
from retry.api import retry
|
||||
from slack import WebClient
|
||||
from slack.errors import SlackApiError
|
||||
from slack.web.slack_response import SlackResponse
|
||||
|
||||
from superset import app
|
||||
|
||||
# Globals
|
||||
config = app.config
|
||||
logger = logging.getLogger("tasks.slack_util")
|
||||
|
||||
|
||||
@ -37,6 +35,7 @@ def deliver_slack_msg(
|
||||
body: str,
|
||||
file: Optional[Union[str, IOBase, bytes]],
|
||||
) -> None:
|
||||
config = current_app.config
|
||||
client = WebClient(token=config["SLACK_API_TOKEN"], proxy=config["SLACK_PROXY"])
|
||||
# files_upload returns SlackResponse as we run it in sync mode.
|
||||
if file:
|
||||
|
@ -323,7 +323,8 @@ class BaseViz:
|
||||
gb = self.groupby
|
||||
metrics = self.all_metrics or []
|
||||
columns = form_data.get("columns") or []
|
||||
groupby = list(set(gb + columns))
|
||||
# merge list and dedup while preserving order
|
||||
groupby = list(OrderedDict.fromkeys(gb + columns))
|
||||
|
||||
is_timeseries = self.is_timeseries
|
||||
if DTTM_ALIAS in groupby:
|
||||
|
Loading…
Reference in New Issue
Block a user