Issue Summary

Gives schema refresh failed error when trying to create query.

Technical details:

Returns 200 from OS:
[2022-09-27 20:35:23,402][PID:41][DEBUG][urllib3.connectionpool] https://search_domain.us-west-2.es.amazonaws.com:443 “GET /_mappings HTTP/1.1” 200 None

  • Redash Version: 10.1.0.b50633
  • Browser/OS: Chrome
  • How did you install Redash: Docker

Looks like it’s not handling mappings properly,

@@ -93,8 +94,8 @@ class ElasticSearch2(BaseHTTPQueryRunner):
             try:
                 for m in index_mappings.get("mappings", {}):
                     _parse_properties('', index_mappings['mappings'][m]['properties'])
-            except KeyError:
-                _parse_properties('', index_mappings['mappings']['properties'])
+            except (KeyError, TypeError):
+                _parse_properties('', index_mappings['mappings'].get('properties', {}))