feat: confirm overwrite when importing (#11982)

* feat: confirm overwrite when importing

* Skip flaky test
This commit is contained in:
Beto Dealmeida
2020-12-10 14:50:10 -08:00
committed by GitHub
parent 9e07e10055
commit 475f59cb1c
17 changed files with 427 additions and 109 deletions

View File

@@ -624,11 +624,19 @@ class DatasetRestApi(BaseSupersetModelRestApi):
---
post:
requestBody:
required: true
content:
application/zip:
multipart/form-data:
schema:
type: string
format: binary
type: object
properties:
formData:
type: string
format: binary
passwords:
type: string
overwrite:
type: bool
responses:
200:
description: Dataset import result
@@ -662,8 +670,11 @@ class DatasetRestApi(BaseSupersetModelRestApi):
if "passwords" in request.form
else None
)
overwrite = request.form.get("overwrite") == "true"
command = ImportDatasetsCommand(contents, passwords=passwords)
command = ImportDatasetsCommand(
contents, passwords=passwords, overwrite=overwrite
)
try:
command.run()
return self.response(200, message="OK")