I reproduce the issue with deck.gl.polygon on Superset v4.0.2
With a different column name the chart is OK
Originally posted by @xavier-GitHub76 in #15965
Comment From: dosubot[bot]
The issue with deck.gl Polygon not working when the column name is "Polygon" or "polygon" in Superset v4.0.2 appears to be related to how Superset and deck.gl process column names and GeoJSON properties. The code for the Polygon layer distinguishes between the property/column name "polygon" (lowercase, typically a data column or GeoJSON property) and the GeoJSON geometry type "Polygon" (capitalized). If there is a mismatch or conflict—such as using "Polygon" as a column name—this can cause errors like TypeError: right-hand side of 'in' should be an object, got undefined
because the code expects a specific structure and case for these fields. This is a case-sensitive issue and can lead to parsing or rendering failures if the conventions are not followed end-to-end (source).
There is no official documentation or open issue directly addressing this specific problem, but it is a known pattern that using reserved words or names that overlap with internal identifiers (like "Polygon") can cause conflicts in visualization tools.
A workaround is to avoid naming your column "Polygon" or "polygon". If you must use these names, ensure you escape them properly in SQL queries (using double quotes and matching the exact case), but even then, the visualization code may still misinterpret the field due to the way it checks for geometry types and properties (source). Renaming the column to something unique (e.g., "poly_geom" or "shape") is the most reliable solution.
It's also important to note that the DeckGL graph feature in Superset is deprecated and no longer maintained, so issues like this may not be resolved in future releases (source). If possible, consider using alternative visualization options for polygon data.
To reply, just mention my name @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
Comment From: rusackas
Can you check in a newer version? I'm unable to reproduce on Preset, which is effectively 4.1.2 plus many more recent fixes.
Comment From: rusackas
Can you check in a newer version? I'm unable to reproduce on Preset, which is effectively 4.1.2 plus many more recent fixes.
Comment From: xavier-GitHub76
The issue is present in 4.1.2
Comment From: xavier-GitHub76
Also in 5.0.0-RC2
Comment From: rusackas
Can you check in a newer version? I'm unable to reproduce on Preset, which is effectively 4.1.2 plus many more recent fixes.
Comment From: xavier-GitHub76
My previous tests were done on 4.0.2, 4.1.2 and 5.0.0-RC2
Can you import the CSV to create a dataset with just one polygon and retry to reproduce it
Comment From: rusackas
Your dataset is working fine on Preset instances... we might have cherried in a few more fixes than are available in the latest official releases, but I'm reasonably confident this works well unless it's a database-specific issue.