From 8a0d279eeade12a25848e28ef08551466548b2b2 Mon Sep 17 00:00:00 2001 From: Christine Chambers Date: Sat, 10 Nov 2018 15:45:03 -0800 Subject: [PATCH] Parse datasource_id as integer on the server side (#6359) - Datasource ids are being serialized into strings on the client side and python's default json.load doesn't deserialize strings representing integers as integers. Adding an integer parsing step when initializing QueryContext. --- superset/common/query_context.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/common/query_context.py b/superset/common/query_context.py index 59bd8b5b49cc9..21b0dac368bc6 100644 --- a/superset/common/query_context.py +++ b/superset/common/query_context.py @@ -19,7 +19,7 @@ def __init__( queries: List[Dict], ): self.datasource = ConnectorRegistry.get_datasource(datasource.get('type'), - datasource.get('id'), + int(datasource.get('id')), db.session) self.queries = list(map(lambda query_obj: QueryObject(**query_obj), queries))