Bug description

How to reproduce:

  1. Have some PostGIS database table(s) with public.geometry (Shape) as column type.
  2. Run any meta database query against the table - it doesn't matter which one, all will fail.
  3. Get an unspecific 1002 error.

Queries triggered from Superset against the PostGIS database directly (not via meta database queries) work fine - even the UI will show some shape numbers related information - useless but also not harmful.

Screenshots/recordings

Buggy (even selecting only a specific non shape column doesn't help):

Image

Fine (even the shape columns are somewhat visualized):

Image

Superset version

4.1.3

Python version

Not applicable

Node version

Not applicable

Browser

Not applicable

Additional context

2025-08-19 12:50:14,889:WARNING:superset.views.error_handling:SupersetErrorException Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1484, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(view_args) File "/usr/local/lib/python3.10/site-packages/flask_appbuilder/security/decorators.py", line 95, in wraps return f(self, *args, kwargs) File "/app/superset/views/base_api.py", line 119, in wraps duration, response = time_function(f, self, args, kwargs) File "/app/superset/utils/core.py", line 1364, in time_function response = func(args, kwargs) File "/usr/local/lib/python3.10/site-packages/flask_appbuilder/api/init.py", line 183, in wraps return f(self, *args, kwargs) File "/app/superset/utils/log.py", line 303, in wrapper value = f(args, *kwargs) File "/app/superset/sqllab/api.py", line 342, in get_results result = SqlExecutionResultsCommand(key=key, rows=rows).run() File "/app/superset/commands/sql_lab/results.py", line 105, in run self.validate() File "/app/superset/commands/sql_lab/results.py", line 73, in validate raise SupersetErrorException( superset.exceptions.SupersetErrorException: Data could not be retrieved from the results backend. You need to re-run the original query.

The exception is a lie though - the relevant query is never even executed. It seems superset dies during examining what it should do with the query as soon as shapes are contained.

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [x] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.