aminghadersohi commented on code in PR #44148:
URL: https://github.com/apache/superset/pull/44148#discussion_r4140998789


##########
superset-frontend/plugins/plugin-chart-country-map/src/CountryMap.ts:
##########
@@ -178,6 +182,11 @@ function CountryMap(element: HTMLElement, props: 
CountryMapProps) {
   // Track mouse position to distinguish clicks from drags
   let mousedownPos: { x: number; y: number } | null = null;
 
+  const sourceValue = (code: string) =>
+    sourceValues && Object.prototype.hasOwnProperty.call(sourceValues, code)
+      ? sourceValues[code]

Review Comment:
   Reviewed at 3f0ff3efdc3753dc6697da898c3105130f206dae; retaining the existing 
Record. The read in CountryMap.ts is conditional on 
Object.prototype.hasOwnProperty.call(sourceValues, code), so inherited 
properties are never returned. transformProps.ts populates the mapping only 
when regionFormat is set, after normalizeRegions resolves each value to an ISO 
code from the bundled boundary table; raw dataset identifiers become values, 
not keys. Unknown or ambiguous region identifiers throw before mapping 
construction. This is not an unguarded arbitrary-key object injection path, and 
converting the prop plus its producer/tests to Map is unnecessary for 
correctness. Country-map Jest cannot run locally because node dependencies are 
absent; CI is the check.



-- 
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