From a31f90178c2e3ac4bb9aafc91d9c881248c0bafb Mon Sep 17 00:00:00 2001 From: Jesse Whitehouse Date: Wed, 29 Jan 2020 08:03:26 -0600 Subject: [PATCH] Fixes output schema variable name. Without this the sorted cache is never returned! ____ ____ ____ _____ / __ \/ __ \/ __ \/ ___/ / /_/ / /_/ / /_/ (__ ) \____/\____/ .___/____/ /_/ --- redash/models/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redash/models/__init__.py b/redash/models/__init__.py index 0aafdbe1dca..78d11cd688a 100644 --- a/redash/models/__init__.py +++ b/redash/models/__init__.py @@ -196,12 +196,12 @@ def get_schema(self, refresh=False): "Error sorting schema columns for data_source {}".format(self.id) ) out_schema = schema - - redis_connection.set(self._schema_key, json_dumps(out_schema)) + finally: + redis_connection.set(self._schema_key, json_dumps(out_schema)) else: - schema = json_loads(cache) + out_schema = json_loads(cache) - return schema + return out_schema def _sort_schema(self, schema): return [