You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ma...@apache.org on 2018/11/10 23:45:09 UTC

[incubator-superset] branch master updated: Parse datasource_id as integer on the server side (#6359)

This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 81349df  Parse datasource_id as integer on the server side (#6359)
81349df is described below

commit 81349df625863a4fcc8cc5f3f5a2d677abf9aae8
Author: Christine Chambers <ch...@gmail.com>
AuthorDate: Sat Nov 10 15:45:03 2018 -0800

    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 59bd8b5..21b0dac 100644
--- a/superset/common/query_context.py
+++ b/superset/common/query_context.py
@@ -19,7 +19,7 @@ class QueryContext:
             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))