bito-code-review[bot] commented on code in PR #37229: URL: https://github.com/apache/superset/pull/37229#discussion_r3455576422
########## superset-frontend/spec/fixtures/mockTimeSeries.ts: ########## @@ -0,0 +1,269 @@ +/** + * 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 { DatasourceType } from '@superset-ui/core'; +import { EchartsTimeseriesChartProps } from '@superset-ui/plugin-chart-echarts'; +import { EchartsMixedTimeseriesProps } from 'plugins/plugin-chart-echarts/src/MixedTimeseries/types'; + +export const mockedTimeSeriesProps: EchartsTimeseriesChartProps = { + // Datasource metadata + datasource: { + id: 1, + name: 'test_datasource', + type: DatasourceType.Table, + columnFormats: {}, + currencyFormats: {}, + verboseMap: { + testing_count: 'Testing count', + 'SUM(money_for_learning)': 'SUM(money_for_learning)', + time_start: 'time_start', + }, + }, + + // Query results + queriesData: [ + { + label_map: { + time_start: ['time_start'], + 'SUM(money_for_learning)': ['SUM(money_for_learning)'], + 'SUM(money_for_learning), 1 day ago': [ + 'SUM(money_for_learning)', + '1 day ago', + ], + 'SUM(money_for_learning), 1 week ago': [ + 'SUM(money_for_learning)', + '1 week ago', + ], + 'SUM(money_for_learning), 1 year ago': [ + 'SUM(money_for_learning)', + '1 year ago', + ], + testing_count: ['testing_count'], + 'testing_count, 1 day ago': ['testing_count', '1 day ago'], + 'testing_count, 1 week ago': ['testing_count', '1 week ago'], + 'testing_count, 1 year ago': ['testing_count', '1 year ago'], + 'Testing count': ['testing_count'], + }, + colnames: [ + 'time_start', + 'SUM(money_for_learning)', + 'SUM(money_for_learning), 1 day ago', + 'SUM(money_for_learning), 1 week ago', + 'SUM(money_for_learning), 1 year ago', + 'testing_count', + 'testing_count, 1 day ago', + 'testing_count, 1 week ago', + 'testing_count, 1 year ago', + ], + indexnames: [0, 1, 2], + coltypes: [2, 0, 0, 0, 1, 0, 0, 0, 1], + data: [ + { + time_start: 1533081600001, + 'SUM(money_for_learning)': 101, + 'SUM(money_for_learning), 1 day ago': null, + 'SUM(money_for_learning), 1 week ago': null, + 'SUM(money_for_learning), 1 year ago': null, + testing_count: 1, + 'testing_count, 1 day ago': null, + 'testing_count, 1 week ago': null, + 'testing_count, 1 year ago': null, + }, + { + time_start: 1533168000001, Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Data value inconsistency</b></div> <div id="fix"> Second row timestamp `1533168000001` has `+1` millisecond, but the corresponding value in mockedMixedTimeSeriesProps at line 219 is `1533168000000`. This mirrors the inconsistency found at line 77. </div> <details> <summary> <b>Code suggestion</b> </summary> <blockquote>Check the AI-generated fix before applying</blockquote> <div id="code"> ``` --- superset-frontend/spec/fixtures/mockTimeSeries.ts (lines 87-97) --- 87: { 88: - time_start: 1533168000001, + time_start: 1533168000000, 89: 'SUM(money_for_learning)': 5791, 90: 'SUM(money_for_learning), 1 day ago': 101, 91: 'SUM(money_for_learning), 1 week ago': null, 92: 'SUM(money_for_learning), 1 year ago': null, 93: testing_count: 131, 94: 'testing_count, 1 day ago': 11, 95: 'testing_count, 1 week ago': null, 96: 'testing_count, 1 year ago': null, 97: }, ``` </div> </details> </div> <small><i>Code Review Run #07eefc</i></small> </div> --- Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>) - [ ] Yes, avoid them ########## superset-frontend/spec/fixtures/mockTimeSeries.ts: ########## @@ -0,0 +1,269 @@ +/** + * 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 { DatasourceType } from '@superset-ui/core'; +import { EchartsTimeseriesChartProps } from '@superset-ui/plugin-chart-echarts'; +import { EchartsMixedTimeseriesProps } from 'plugins/plugin-chart-echarts/src/MixedTimeseries/types'; + +export const mockedTimeSeriesProps: EchartsTimeseriesChartProps = { + // Datasource metadata + datasource: { + id: 1, + name: 'test_datasource', + type: DatasourceType.Table, + columnFormats: {}, + currencyFormats: {}, + verboseMap: { + testing_count: 'Testing count', + 'SUM(money_for_learning)': 'SUM(money_for_learning)', + time_start: 'time_start', + }, + }, + + // Query results + queriesData: [ + { + label_map: { + time_start: ['time_start'], + 'SUM(money_for_learning)': ['SUM(money_for_learning)'], + 'SUM(money_for_learning), 1 day ago': [ + 'SUM(money_for_learning)', + '1 day ago', + ], + 'SUM(money_for_learning), 1 week ago': [ + 'SUM(money_for_learning)', + '1 week ago', + ], + 'SUM(money_for_learning), 1 year ago': [ + 'SUM(money_for_learning)', + '1 year ago', + ], + testing_count: ['testing_count'], + 'testing_count, 1 day ago': ['testing_count', '1 day ago'], + 'testing_count, 1 week ago': ['testing_count', '1 week ago'], + 'testing_count, 1 year ago': ['testing_count', '1 year ago'], + 'Testing count': ['testing_count'], + }, + colnames: [ + 'time_start', + 'SUM(money_for_learning)', + 'SUM(money_for_learning), 1 day ago', + 'SUM(money_for_learning), 1 week ago', + 'SUM(money_for_learning), 1 year ago', + 'testing_count', + 'testing_count, 1 day ago', + 'testing_count, 1 week ago', + 'testing_count, 1 year ago', + ], + indexnames: [0, 1, 2], + coltypes: [2, 0, 0, 0, 1, 0, 0, 0, 1], + data: [ + { + time_start: 1533081600001, Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Data value inconsistency</b></div> <div id="fix"> Timestamp value `1533081600001` has `+1` millisecond, but the corresponding value in mockedMixedTimeSeriesProps at line 208 is `1533081600000`. This inconsistency may cause test failures when both mocks are compared or used in the same test scenario. </div> <details> <summary> <b>Code suggestion</b> </summary> <blockquote>Check the AI-generated fix before applying</blockquote> <div id="code"> ``` --- superset-frontend/spec/fixtures/mockTimeSeries.ts (lines 76-86) --- 76: { 77: - time_start: 1533081600001, + time_start: 1533081600000, 78: 'SUM(money_for_learning)': 101, 79: 'SUM(money_for_learning), 1 day ago': null, 80: 'SUM(money_for_learning), 1 week ago': null, 81: 'SUM(money_for_learning), 1 year ago': null, 82: testing_count: 1, 83: 'testing_count, 1 day ago': null, 84: 'testing_count, 1 week ago': null, 85: 'testing_count, 1 year ago': null, 86: }, ``` </div> </details> </div> <small><i>Code Review Run #07eefc</i></small> </div> --- Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>) - [ ] Yes, avoid them -- 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]
