You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/03/04 09:13:27 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9161: fix: share column type matching between model and result set

dpgaspar commented on a change in pull request #9161: fix: share column type matching between model and result set
URL: https://github.com/apache/incubator-superset/pull/9161#discussion_r387531831
 
 

 ##########
 File path: superset/connectors/sqla/models.py
 ##########
 @@ -145,6 +145,27 @@ class TableColumn(Model, BaseColumn):
     update_from_object_fields = [s for s in export_fields if s not in ("table_id",)]
     export_parent = "table"
 
+    @property
+    def is_num(self) -> bool:
+        db_engine_spec = self.table.database.db_engine_spec
+        return db_engine_spec.is_db_column_type_match(
+            self.type, utils.DbColumnType.NUMERIC
+        )
+
+    @property
+    def is_string(self) -> bool:
+        db_engine_spec = self.table.database.db_engine_spec
+        return db_engine_spec.is_db_column_type_match(
+            self.type, utils.DbColumnType.STRING
+        )
+
+    @property
+    def is_time(self) -> bool:
 
 Review comment:
   On `SupersetResultSet` we have a very similar method named `is_date` using `DbColumnType.TEMPORAL`. Consider changing to `is_date`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org