added explore database for ctas/cvas (#10174)

Co-authored-by: Jason Davis <@dropbox.com>
This commit is contained in:
Jason Davis
2020-06-29 11:13:54 -07:00
committed by GitHub
parent 4342c33d0e
commit 72fc581b15
6 changed files with 27 additions and 2 deletions

View File

@@ -137,6 +137,7 @@ class DatabaseRestApi(DatabaseMixin, BaseSupersetModelRestApi):
"allows_subquery",
"allows_cost_estimate",
"allows_virtual_table_explore",
"explore_database_id",
"backend",
"function_names",
]

View File

@@ -187,7 +187,7 @@ class CsvToDatabaseView(SimpleFormView):
# E.g. if hive was used to upload a csv, presto will be a better option
# to explore the table.
expore_database = database
explore_database_id = database.get_extra().get("explore_database_id", None)
explore_database_id = database.explore_database_id
if explore_database_id:
expore_database = (
db.session.query(models.Database)