bito-code-review[bot] commented on code in PR #38094:
URL: https://github.com/apache/superset/pull/38094#discussion_r4182470815
##########
superset-frontend/src/visualizations/TimeTable/utils/numberUtils/numberUtils.ts:
##########
@@ -19,13 +19,14 @@
/**
* Safely parses a value to a numeric type
- * @param value - The value to parse (string, number, or null)
- * @returns The numeric value or 0 if invalid
+ * @param value - The value to parse (string, number, null, or undefined)
+ * @returns The numeric value or null if invalid or not parseable
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Doc contract vs parse behavior</b></div>
<div id="fix">
The updated doc says `null if invalid or not parseable`, but `parseFloat`
parses a leading numeric prefix, so `parseToNumber('123abc')` returns `123`
rather than `null`. `FormattedNumber` would then render `123` instead of
`NULL_DISPLAY` for such a value. Consider a strict whole-string parse (trim +
`Number()` + NaN check) so the contract matches behavior.
</div>
</div>
<small><i>Code Review Run #02d414</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]