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


##########
superset-frontend/packages/superset-ui-core/src/color/CategoricalColorScale.ts:
##########
@@ -396,17 +396,24 @@ class CategoricalColorScale extends ExtensibleFunction {
   /**
    * Returns the current unknown value, which defaults to "implicit".
    */
-  unknown(): string | { name: 'implicit' };
+  unknown(): { name: 'implicit' };

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Getter return type mismatch</b></div>
   <div id="fix">
   
   The getter return type was narrowed from `string | { name: 'implicit' }` to 
just `{ name: 'implicit' }`, which is incorrect. At runtime, 
`this.scale.unknown()` returns the value that was set (potentially a string 
like '#666'), not always the default `{ name: 'implicit' }`. This type 
declaration mismatches the actual return value from the implementation at line 
418, causing potential TypeScript errors when callers use the return value.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #c3c257</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