Fix for BigQuery connection checks and CSV uploads (#8511)

* Fix for BigQuery connection checks and CSV uploads

* Don't assume encrypted_extra will be populated

* Fix undefined method error

* Refactor to avoid circular import strangeness
This commit is contained in:
Will Barrett
2019-11-19 14:50:47 -08:00
committed by Maxime Beauchemin
parent 3b97ae3b9d
commit d70e0fc359
6 changed files with 25 additions and 12 deletions

View File

@@ -120,8 +120,12 @@ class CsvToDatabaseView(SimpleFormView):
utils.ensure_path_exists(config["UPLOAD_FOLDER"])
csv_file.save(path)
table_name = form.name.data
database = form.data.get("con")
database.db_engine_spec.create_table_from_csv(form)
con = form.data.get("con")
database = (
db.session.query(models.Database).filter_by(id=con.data.get("id")).one()
)
database.db_engine_spec.create_table_from_csv(form, database)
table = (
db.session.query(SqlaTable)