bito-code-review[bot] commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4179128861
##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts:
##########
@@ -66,30 +119,40 @@ function processScatterData(
categoryColumn,
]);
+ const parsedFixedRadius = parseMetricValue(fixedRadiusValue);
+
return spatialFeatures.map(feature => {
let scatterPoint: ScatterPoint = {
position: feature.position,
extraProps: feature.extraProps || {},
};
+ // Reserved source columns live in extraProps to protect computed geometry.
+ const getSourceValue = (column?: string): unknown =>
+ column
+ ? feature.extraProps && column in feature.extraProps
+ ? feature.extraProps[column]
+ : feature[column]
+ : undefined;
Review Comment:
<!-- Bito Reply -->
The suggestion to use `Object.prototype.hasOwnProperty.call` is correct and
should be applied. It ensures that the lookup for metric or dimension values
correctly respects own properties and avoids potential issues where inherited
properties (like `constructor` or `toString`) might mask the intended data,
which is a known risk when using the `in` operator.
**superset-frontend/plugins/preset-chart-deckgl/src/layers/Scatter/transformProps.ts**
```
const getSourceValue = (column?: string): unknown =>
column
? feature.extraProps &&
Object.prototype.hasOwnProperty.call(feature.extraProps, column)
? feature.extraProps[column]
: feature[column]
: undefined;
```
--
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]