bito-code-review[bot] commented on PR #41469:
URL: https://github.com/apache/superset/pull/41469#issuecomment-4814323850

   <!-- Bito Reply -->
   The flagged issue is correct. When `formDataCopy.row_limit` is a non-numeric 
string, `Number()` returns `NaN`, which is then assigned to 
`moreProps.row_limit`. This causes inconsistent query objects and cache misses. 
To resolve this, you should check if the result of `Number()` is a valid number 
(i.e., not `NaN`) before assigning it, or default to `undefined` if it is 
invalid.
   
   Here is the corrected implementation for 
`superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts`:
   
   ```typescript
         const rowLimit = Number(formDataCopy.row_limit);
         moreProps.row_limit =
           formDataCopy.row_limit != null && !Number.isNaN(rowLimit)
             ? rowLimit
             : undefined;
   ```
   
   There are no other review comments in this pull request to address.
   
   **superset-frontend/plugins/plugin-chart-table/src/buildQuery.ts**
   ```
   const rowLimit = Number(formDataCopy.row_limit);
         moreProps.row_limit =
           formDataCopy.row_limit != null && !Number.isNaN(rowLimit)
             ? rowLimit
             : undefined;
   ```


-- 
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]

Reply via email to