sadpandajoe commented on code in PR #42591:
URL: https://github.com/apache/superset/pull/42591#discussion_r3694598304


##########
superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts:
##########
@@ -529,4 +529,48 @@ describe('Polygon transformProps', () => {
     expect(features[0]?.extraProps?.['SUM(population)']).toBe(50000);
     expect(features[0]?.metrics?.['SUM(population)']).toBe(50000);
   });
+
+  // Regression test for #33669: a boundary column literally named "polygon"
+  // (the same key this transform uses internally for the parsed geometry)
+  // reportedly broke rendering, because the raw column value could
+  // theoretically collide with the `polygon` key this function builds on
+  // each feature. `line_column` is excluded before spreading a record's
+  // other properties onto the feature, and the parsed `polygon` key is
+  // assigned last in the returned object literal, so it should always win
+  // over anything copied from the raw record, even when they share a name.
+  test('should correctly parse polygon geometry when the boundary column is 
itself named "polygon"', () => {
+    const collidingColumnNameProps = {
+      ...mockChartProps,
+      rawFormData: {
+        ...mockChartProps.rawFormData,
+        line_column: 'polygon',
+      },
+      queriesData: [
+        {
+          data: [
+            {
+              polygon: JSON.stringify([
+                [-122.4, 37.8],
+                [-122.3, 37.8],
+                [-122.3, 37.9],

Review Comment:
   The regression fixture does not reproduce the input attached to #33669: that 
CSV stores a GeoJSON  with nested , while this uses a bare coordinate array 
(and only lowercase , although the issue also reports ). Those shapes take 
different parsing paths, so this test can pass while the reported case remains 
unverified. Since this PR is intended to close the issue as already fixed, 
please use the reported Feature-shaped value and cover both reported 
column-name cases (or narrow the issue-closing claim).



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