bito-code-review[bot] commented on code in PR #43396:
URL: https://github.com/apache/superset/pull/43396#discussion_r3831872549


##########
superset/utils/pandas_postprocessing/histogram.py:
##########
@@ -45,6 +54,14 @@ def histogram(
                and each column corresponds to a histogram bin. The values are 
the counts in each bin.
     """  # noqa: E501
 
+    if not isinstance(bins, int) or not 1 <= bins <= MAX_HISTOGRAM_BINS:

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>CWE-20: Type check too strict</b></div>
   <div id="fix">
   
   Modify the type validation to accept numpy integer subclasses by changing 
the check to `isinstance(bins, (int, np.integer))`. (See also: 
[CWE-20](https://cwe.mitre.org/data/definitions/20.html))
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #b2e231</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]

Reply via email to