bito-code-review[bot] commented on PR #41775:
URL: https://github.com/apache/superset/pull/41775#issuecomment-4884406542
<!-- Bito Reply -->
The flagged issue is correct. The removal of `None` from the type hint and
the deletion of the `if value is None` check causes an `AttributeError` when
`None` is passed, as `value.isdigit()` is called without a null guard. To
resolve this, restore `None` to the type hint and re-add the early return for
`None` values.
**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
if value.isdigit():
```
--
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]