rusackas commented on code in PR #40967:
URL: https://github.com/apache/superset/pull/40967#discussion_r3394639721
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/buildQuery.test.ts:
##########
@@ -46,6 +46,24 @@ describe('Timeseries buildQuery', () => {
expect(query.orderby).toEqual([['bar', false]]);
});
+ test('should include the scatter dot size metric in query metrics', () => {
+ const queryContext = buildQuery({
+ ...formData,
+ size: 'qux',
+ });
+ const [query] = queryContext.queries;
+ expect(query.metrics).toEqual(['bar', 'baz', 'qux']);
+ });
Review Comment:
`size` does get into the query metrics, just not via `buildQuery` itself —
`extractQueryFields` in core aliases `size: 'metrics'`, so the value flows in
through `buildQueryObject`. The test passes in CI for that reason.
##########
superset-frontend/plugins/plugin-chart-echarts/test/Timeseries/buildQuery.test.ts:
##########
@@ -46,6 +46,24 @@ describe('Timeseries buildQuery', () => {
expect(query.orderby).toEqual([['bar', false]]);
});
+ test('should include the scatter dot size metric in query metrics', () => {
+ const queryContext = buildQuery({
+ ...formData,
+ size: 'qux',
+ });
+ const [query] = queryContext.queries;
+ expect(query.metrics).toEqual(['bar', 'baz', 'qux']);
+ });
+
+ test('should dedupe the dot size metric when it is also a value metric', ()
=> {
+ const queryContext = buildQuery({
+ ...formData,
+ size: 'bar',
+ });
+ const [query] = queryContext.queries;
+ expect(query.metrics).toEqual(['bar', 'baz']);
+ });
Review Comment:
Same as the sibling thread — `extractQueryFields` aliases `size` into
`metrics` and `removeDuplicates` handles the dedupe, so the value-metric
collision case works without anything in `buildQuery.ts`. Green in CI.
--
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]