zhaoyongjie commented on code in PR #23274:
URL: https://github.com/apache/superset/pull/23274#discussion_r1125860425
##########
superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/buildQuery.ts:
##########
@@ -62,22 +63,26 @@ export default function buildQuery(formData: QueryFormData)
{
2015-03-01 318.0 0.0
*/
+ // only add series limit metric if it's explicitly needed e.g. for sorting
+ const extra_metrics = extractExtraMetrics(formData);
Review Comment:
I'm thinking whether or not setting `extraMetrics` into the metrics field in
the `queryObject`, if so might this logic put it in `buildQueryObject` in the
`superset-ui/core`.
What do you think about this one?
##########
superset-frontend/packages/superset-ui-chart-controls/src/operators/pivotOperator.ts:
##########
@@ -24,12 +24,15 @@ import {
getXAxisLabel,
} from '@superset-ui/core';
import { PostProcessingFactory } from './types';
+import { extractExtraMetrics } from './utils';
export const pivotOperator: PostProcessingFactory<PostProcessingPivot> = (
formData,
queryObject,
) => {
const metricLabels = ensureIsArray(queryObject.metrics).map(getMetricLabel);
+ const extraMetrics = extractExtraMetrics(formData);
+ metricLabels.push(...extraMetrics.map(getMetricLabel));
Review Comment:
a little bit code style changing in order to readability.
``` suggestion
const metricLabels = [
...ensureIsArray(queryObject.metrics),
...extractExtraMetrics(formData)
].map(getMetricLabel);
```
--
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]