You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2026/07/29 23:43:32 UTC
(superset) branch tdd/issue-33669-deckgl-polygon-column-name created (now f674171aa29)
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a change to branch tdd/issue-33669-deckgl-polygon-column-name
in repository https://gitbox.apache.org/repos/asf/superset.git
at f674171aa29 test(deckgl): Polygon chart with a column literally named "polygon" (#33669)
This branch includes the following new commits:
new f674171aa29 test(deckgl): Polygon chart with a column literally named "polygon" (#33669)
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(superset) 01/01: test(deckgl): Polygon chart with a column literally named "polygon" (#33669)
Posted by ru...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch tdd/issue-33669-deckgl-polygon-column-name
in repository https://gitbox.apache.org/repos/asf/superset.git
commit f674171aa29d8465f20b212c0cc0e276e1537bf0
Author: Claude Code <no...@anthropic.com>
AuthorDate: Wed Jul 29 16:42:11 2026 -0700
test(deckgl): Polygon chart with a column literally named "polygon" (#33669)
Regression for #33669: a boundary column named "polygon" allegedly
broke deck.gl Polygon chart rendering, presumably a naming collision
with the internal `polygon` key transformProps.ts builds on each
feature. Adds a test pinning the actual reported scenario against the
current preset-chart-deckgl Polygon transform (the prior investigation
in the issue thread tested the wrong chart type, deck.gl GeoJSON
instead of Polygon).
The test passes: `line_column` is excluded before a record's other
properties are spread onto the feature, and the parsed `polygon` key
is assigned last in the returned object literal, so it always wins
over anything copied from the raw record, even when they share a name.
Closes #33669
Co-Authored-By: Claude Sonnet 5 <no...@anthropic.com>
---
.../src/layers/Polygon/transformProps.test.ts | 44 ++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts b/superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts
index cb29f078e0b..b68a0f15e27 100644
--- a/superset-frontend/plugins/preset-chart-deckgl/src/layers/Polygon/transformProps.test.ts
+++ b/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],
+ [-122.4, 37.9],
+ ]),
+ population: 50000,
+ },
+ ],
+ },
+ ],
+ };
+
+ const result = transformProps(collidingColumnNameProps as ChartProps);
+ const features = result.payload.data.features as PolygonFeature[];
+
+ expect(features).toHaveLength(1);
+ expect(features[0]?.polygon).toEqual([
+ [-122.4, 37.8],
+ [-122.3, 37.8],
+ [-122.3, 37.9],
+ [-122.4, 37.9],
+ ]);
+ });
});