From 4ded37e71edf1306ee9652cf32324b5dc14a1328 Mon Sep 17 00:00:00 2001 From: Maxime Beauchemin Date: Wed, 15 Mar 2017 08:19:29 -0700 Subject: [PATCH] [hotfix] handle missing or empty column type --- superset/connectors/base.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/superset/connectors/base.py b/superset/connectors/base.py index bdb7852f5129a..46bc9581fedb9 100644 --- a/superset/connectors/base.py +++ b/superset/connectors/base.py @@ -117,15 +117,24 @@ def __repr__(self): @property def is_num(self): - return any([t in self.type.upper() for t in self.num_types]) + return ( + self.type and + any([t in self.type.upper() for t in self.num_types]) + ) @property def is_time(self): - return any([t in self.type.upper() for t in self.date_types]) + return ( + self.type and + any([t in self.type.upper() for t in self.date_types]) + ) @property def is_string(self): - return any([t in self.type.upper() for t in self.str_types]) + return ( + self.type and + any([t in self.type.upper() for t in self.str_types]) + ) class BaseMetric(AuditMixinNullable, ImportMixin):