sadpandajoe commented on code in PR #44657: URL: https://github.com/apache/superset/pull/44657#discussion_r4176141924
########## superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/resultAggregation.ts: ########## @@ -0,0 +1,118 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import { t } from '@apache-superset/core/translation'; + +/** + * A "result aggregation" is a second aggregation pass over a metric's own + * grouped results (e.g. the median of a set of per-store SUM(sales) values), + * distinct from -- and independent of -- the metric's own SQL aggregate. This + * is the pre-SIP-216 "Aggregation function" control's actual job: it never + * touched leaf cells (those were always the metric's own aggregate), only + * how subtotals/totals summarized the leaf cells beneath them. SIP-216 + * removed the control because that summarization was computed by re-folding + * already-displayed cell values client-side, which is wrong for non-additive + * reducers (see SIP.md). This module restores the same choice, computed + * correctly: every scope (cell, subtotal, grand total) is reduced from its + * own original contributing query results, never from another scope's + * already-computed output. + */ +export const RESULT_AGGREGATIONS = [ + 'Count', Review Comment: Selecting Count with row or column summaries now makes CSV/XLSX exports and tabular reports raise `TypeError: Series.count() got an unexpected keyword argument 'axis'`: `pivot_df` passes a DataFrame plus `axis` to a Series-only reducer (Count Unique Values, List Unique Values, First and Last also fail). Could these restored choices support the summary invocation, with a `pivot_table_v2` regression for each summary axis? -- 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]
