bito-code-review[bot] commented on code in PR #41976:
URL: https://github.com/apache/superset/pull/41976#discussion_r3566566589
##########
superset-frontend/src/visualizations/TimeTable/components/ValueCell/ValueCell.tsx:
##########
@@ -16,37 +16,32 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { ReactElement, useMemo } from 'react';
-import { colorFromBounds, calculateCellValue } from '../../utils';
+import { ReactElement} from 'react';
+import { colorFromBounds } from '../../utils';
import FormattedNumber from '../FormattedNumber';
-import type { ColumnConfig, Entry } from '../../types';
+import type { ColumnConfig } from '../../types';
interface ValueCellProps {
- valueField: string;
+ value: number | null;
+ errorMsg?: string;
column: ColumnConfig;
- reversedEntries: Entry[];
}
-
/**
* Renders a value cell with different calculation types (time, contrib, avg)
* and applies color coding based on bounds
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>JSDoc describes removed behavior</b></div>
<div id="fix">
JSDoc comment at lines 30-31 states component 'renders a value cell with
different calculation types (time, contrib, avg)' but the diff removes all
calculation logic. The component now only displays pre-computed values passed
as props.
</div>
</div>
<small><i>Code Review Run #9bf547</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/src/visualizations/TimeTable/components/ValueCell/ValueCell.test.tsx:
##########
@@ -34,13 +35,19 @@ const mockEntries = [
// eslint-disable-next-line no-restricted-globals -- TODO: Migrate from
describe blocks
describe('ValueCell', () => {
test('should render simple value without special column type', () => {
- render(
- <ValueCell
- valueField="sales"
- column={mockColumn}
- reversedEntries={mockEntries}
- />,
- );
+const { value, errorMsg } = calculateCellValue(
+ 'sales',
+ mockColumn,
+ mockEntries,
+);
+
+render(
+ <ValueCell
+ value={value}
+ errorMsg={errorMsg}
+ column={mockColumn}
+ />,
+);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Broken test function scope</b></div>
<div id="fix">
The `calculateCellValue` call and `render` call are not inside the test
function body — they are at column 0, same as `describe`/`test`. All 10 test
cases in this file have this problem (lines 38-50, 63-75, 88-100, 113-125,
136-148, 160-172, 184-196, 211-223, 241-253, 263-281). The test body is empty
and assertions will not execute. See also `valueCalculations.test.ts` which has
correct indentation for the same function calls.
</div>
</div>
<small><i>Code Review Run #9bf547</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]