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

   <!-- Bito Reply -->
   The flagged issue is correct. The removal of `None` from the input type and 
the deletion of the `if value is None` guard causes an `AttributeError` when 
`None` is passed to `cast_to_num`, violating the function's documented contract 
and breaking existing tests.
   
   To resolve this, restore `None` to the input type and re-introduce the 
explicit check for `None` at the beginning of the function.
   
   Would you like me to implement this fix? If you agree, I can also check for 
other comments on this PR and address them as well.
   
   **superset/utils/core.py**
   ```
   def cast_to_num(value: float | int | str | None) -> float | int | None:
       # ... (docstring)
       if value is None:
           return None
       if isinstance(value, (int, float)):
           return value
   ```


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