You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@superset.apache.org by gi...@git.apache.org on 2017/09/21 15:44:51 UTC

[GitHub] Mogball commented on a change in pull request #3509: Add Table performance improvements

Mogball commented on a change in pull request #3509: Add Table performance improvements
URL: https://github.com/apache/incubator-superset/pull/3509#discussion_r140281124
 
 

 ##########
 File path: superset/models/core.py
 ##########
 @@ -743,6 +744,16 @@ def get_perm(self):
         return (
             "[{obj.database_name}].(id:{obj.id})").format(obj=self)
 
+    def has_table(self, table):
+        engine = self.get_sqla_engine()
+        return engine.dialect.has_table(
+            engine, table.table_name, table.schema or None)
+
+    def get_dialect(self):
+        sqla_url = url.make_url(self.sqlalchemy_uri_decrypted)
+        entrypoint = sqla_url._get_entrypoint()
 
 Review comment:
   There's a bit more overhead to it, plus creating an engine just to get the dialect and then ignoring the instance seems wasteful.
   
   These few lines are what `create_engine` does to determine dialect anyway.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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