From b08939e2e1e22d4a24760027a601fee481b78807 Mon Sep 17 00:00:00 2001 From: Boris Hajduk Date: Sat, 6 May 2017 17:24:58 +0800 Subject: [PATCH 1/3] Decimal is a valid numeric type This will allow automatic creation of sum__ and avg__ metrics --- superset/connectors/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/connectors/base.py b/superset/connectors/base.py index 10c5dd66bf56e..06ed64c361476 100644 --- a/superset/connectors/base.py +++ b/superset/connectors/base.py @@ -168,7 +168,7 @@ class BaseColumn(AuditMixinNullable, ImportMixin): def __repr__(self): return self.column_name - num_types = ('DOUBLE', 'FLOAT', 'INT', 'BIGINT', 'LONG', 'REAL', 'NUMERIC') + num_types = ('DOUBLE', 'FLOAT', 'INT', 'BIGINT', 'LONG', 'REAL', 'NUMERIC', 'DECIMAL') date_types = ('DATE', 'TIME', 'DATETIME') str_types = ('VARCHAR', 'STRING', 'CHAR') From 31f233f6b75a5b7c6a529f9db74057c76953bf49 Mon Sep 17 00:00:00 2001 From: Boris Hajduk Date: Mon, 8 May 2017 12:06:42 +0800 Subject: [PATCH 2/3] formatting for line length at 80 chars --- superset/connectors/base.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/superset/connectors/base.py b/superset/connectors/base.py index 06ed64c361476..08768d66f308e 100644 --- a/superset/connectors/base.py +++ b/superset/connectors/base.py @@ -168,7 +168,9 @@ class BaseColumn(AuditMixinNullable, ImportMixin): def __repr__(self): return self.column_name - num_types = ('DOUBLE', 'FLOAT', 'INT', 'BIGINT', 'LONG', 'REAL', 'NUMERIC', 'DECIMAL') + num_types = ( + 'DOUBLE', 'FLOAT', 'INT', 'BIGINT', 'LONG', 'REAL', 'NUMERIC', 'DECIMAL' + ) date_types = ('DATE', 'TIME', 'DATETIME') str_types = ('VARCHAR', 'STRING', 'CHAR') From 5128ad4b5225333968dbf1426930ca659e576381 Mon Sep 17 00:00:00 2001 From: Boris Hajduk Date: Mon, 8 May 2017 12:11:53 +0800 Subject: [PATCH 3/3] Reformating again, for the mandatory 79 chars maximum. --- superset/connectors/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superset/connectors/base.py b/superset/connectors/base.py index 08768d66f308e..982b3bd75898a 100644 --- a/superset/connectors/base.py +++ b/superset/connectors/base.py @@ -169,7 +169,8 @@ def __repr__(self): return self.column_name num_types = ( - 'DOUBLE', 'FLOAT', 'INT', 'BIGINT', 'LONG', 'REAL', 'NUMERIC', 'DECIMAL' + 'DOUBLE', 'FLOAT', 'INT', 'BIGINT', + 'LONG', 'REAL', 'NUMERIC', 'DECIMAL' ) date_types = ('DATE', 'TIME', 'DATETIME') str_types = ('VARCHAR', 'STRING', 'CHAR')