mirror of
https://github.com/apache/superset.git
synced 2026-05-12 03:15:55 +00:00
feat(advanced analysis): support MultiIndex column in post processing stage (#19116)
This commit is contained in:
committed by
Ville Brofeldt
parent
f8a92de75c
commit
9bc76337cf
@@ -20,7 +20,7 @@ from flask_babel import gettext as _
|
||||
from pandas import DataFrame
|
||||
|
||||
from superset.constants import NULL_STRING, PandasAxis
|
||||
from superset.exceptions import QueryObjectValidationError
|
||||
from superset.exceptions import InvalidPostProcessingError
|
||||
from superset.utils.pandas_postprocessing.utils import (
|
||||
_flatten_column_after_pivot,
|
||||
_get_aggregate_funcs,
|
||||
@@ -64,14 +64,14 @@ def pivot( # pylint: disable=too-many-arguments,too-many-locals
|
||||
:param flatten_columns: Convert column names to strings
|
||||
:param reset_index: Convert index to column
|
||||
:return: A pivot table
|
||||
:raises QueryObjectValidationError: If the request in incorrect
|
||||
:raises InvalidPostProcessingError: If the request in incorrect
|
||||
"""
|
||||
if not index:
|
||||
raise QueryObjectValidationError(
|
||||
raise InvalidPostProcessingError(
|
||||
_("Pivot operation requires at least one index")
|
||||
)
|
||||
if not aggregates:
|
||||
raise QueryObjectValidationError(
|
||||
raise InvalidPostProcessingError(
|
||||
_("Pivot operation must include at least one aggregate")
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user