zhaoyongjie commented on a change in pull request #16945:
URL: https://github.com/apache/superset/pull/16945#discussion_r722897650
##########
File path: superset/utils/pandas_postprocessing.py
##########
@@ -405,10 +417,20 @@ def rolling( # pylint: disable=too-many-arguments
options=rolling_type_options,
)
) from ex
- df = _append_columns(df, df_rolling, columns)
+
+ if is_pivot_df:
+ agg_in_pivot_df =
df.columns.get_level_values(0).drop_duplicates().to_list()
+ agg: Dict[str, Dict[str, Any]] = {col: {} for col in agg_in_pivot_df}
+ df_rolling.columns = [
+ _flatten_column_after_pivot(col, agg) for col in df_rolling.columns
+ ]
Review comment:
I will create a separate PR for refactoring _flatten_column_after_pivot
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]