dpgaspar commented on a change in pull request #5449: [schema] Updating the 
tables schema
URL: 
https://github.com/apache/incubator-superset/pull/5449#discussion_r332412123
 
 

 ##########
 File path: superset/connectors/sqla/views.py
 ##########
 @@ -348,14 +353,7 @@ class TableModelView(DatasourceModelView, DeleteMixin, 
YamlExportMixin):  # noqa
     }
 
     def pre_add(self, table):
-        with db.session.no_autoflush:
-            table_query = db.session.query(models.SqlaTable).filter(
-                models.SqlaTable.table_name == table.table_name,
-                models.SqlaTable.schema == table.schema,
-                models.SqlaTable.database_id == table.database.id,
-            )
-            if db.session.query(table_query.exists()).scalar():
-                raise 
Exception(get_datasource_exist_error_msg(table.full_name))
+        models.SqlaTable.before_insert(None, None, table)
 
 Review comment:
   Is this still an issue?

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to