Copilot commented on code in PR #15898:
URL: https://github.com/apache/pinot/pull/15898#discussion_r2107490911


##########
pinot-controller/src/main/resources/app/pages/Query.tsx:
##########
@@ -624,16 +643,37 @@ const QueryPage = () => {
                       </Alert>
                       <Box m={"16px"}></Box>
 
-                      {
-                        showException && resultError.map((error) => (
-                          <Box style={{paddingBottom: "10px"}}>
-                            <Alert className={classes.sqlError} 
severity="error">
-                              {error.errorCode && <Typography 
variant="body2">Error Code: {error.errorCode}</Typography>}
-                              {error.message}
-                            </Alert>
-                          </Box>
-                        ))
-                      }
+                      {showErrorType === ErrorViewType.EXCEPTION && (
+                          resultError.map((error) => (
+                              <Box style={{paddingBottom: "10px"}}>

Review Comment:
   Add a unique `key` prop to the elements returned by `resultError.map` to 
avoid React list key warnings and ensure stable rendering.
   ```suggestion
                             resultError.map((error, index) => (
                                 <Box key={error.errorCode ? error.errorCode : 
`error-${index}`} style={{paddingBottom: "10px"}}>
   ```



##########
pinot-controller/src/main/resources/app/pages/Query.tsx:
##########
@@ -608,9 +614,22 @@ const QueryPage = () => {
                         className={classes.sqlError} 
                         severity="error" 
                         action={
+
                           <FormControlLabel
-                            control={<Switch color="primary" 
checked={showException} onChange={(e) => setShowException(e.target.checked)} 
name="checkedA" />}
-                            label={<Typography variant='body2'>Show 
Exceptions</Typography>}
+                              labelPlacement='start'
+                              control={
+                                <ButtonGroup color='primary' size='small'>
+                                  <Button onClick={() => 
setShowErrorType(ErrorViewType.EXCEPTION)} variant={showErrorType === 
ErrorViewType.EXCEPTION ? "contained" : "outlined"}>Exception</Button>
+                                  <Button onClick={() => 
setShowErrorType(ErrorViewType.JSON)} variant={showErrorType === 
ErrorViewType.JSON ? "contained" : "outlined"}>Json</Button>
+                                  {
+                                    stageStats && 
Object.keys(stageStats).length > 0 &&
+                                    <Button onClick={() => 
setShowErrorType(ErrorViewType.VISUAL)} variant={showErrorType === 
ErrorViewType.VISUAL ? "contained" : "outlined"}>Visual</Button>
+                                  }
+                                </ButtonGroup>
+                              }
+                              label={<Typography style={{marginRight: 
"8px"}}>View</Typography>}

Review Comment:
   [nitpick] Replace inline style objects with a class rule in `useStyles` to 
keep styling consistent and maintainable.



-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to