rusackas commented on code in PR #41318:
URL: https://github.com/apache/superset/pull/41318#discussion_r3538689143
##########
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:
Correction: reverted this. The narrowed getter is actually necessary — it
keeps `CategoricalColorScale` structurally assignable to d3's real
`ScaleOrdinal<{ toString(): string }, string>` (locked in by the existing "is
compatible with D3's ScaleOrdinal" test in this same file). Widening it back to
`string | { name: 'implicit' }` broke that assignability check under
`@types/[email protected]` and failed CI. The imprecision here is a deliberate,
tested trade-off, not an oversight — the one internal caller (`copy()`) just
round-trips the value straight back into the setter, so it's not exposed as a
footgun in practice.
--
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]