aminghadersohi commented on code in PR #45099:
URL: https://github.com/apache/superset/pull/45099#discussion_r4225424207


##########
superset/commands/report/execute.py:
##########
@@ -1165,6 +1175,11 @@ def _get_chart_data_request_payload(
 
             if form_data.get("server_pagination"):
                 row_limit = form_data.get("row_limit") or 0

Review Comment:
   The `int()` conversion suggested in the earlier review mishandles limits 
Explore's validator accepts: `"15.0"` becomes `SQL_MAX_ROW` (100,000 rows for a 
15-row chart) and `"-5"` stays negative and fails schema validation. This 
mirrors the table plugin's `Number(row_limit) || 0`.
   
   ```suggestion
                   try:
                       row_limit = max(int(float(form_data.get("row_limit") or 
0)), 0)
                   except (TypeError, ValueError, OverflowError):
                       row_limit = 0
   ```



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