mirror of
https://github.com/apache/superset.git
synced 2026-04-20 00:24:38 +00:00
feat: confirm overwrite when importing (#11982)
* feat: confirm overwrite when importing * Skip flaky test
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user