aminghadersohi commented on code in PR #44264:
URL: https://github.com/apache/superset/pull/44264#discussion_r4024217575
##########
superset/commands/database/exceptions.py:
##########
@@ -170,10 +170,12 @@ class DatabaseDeleteSoftDeletedDatasetsExistFailedError(
# are hidden (soft-deleted) rows even though their dataset list looks
empty.
message = _(
"Cannot delete a database whose only remaining datasets are "
- "soft-deleted. Restore them (POST /api/v1/dataset/<uuid>/restore) "
- "and delete them permanently once a purge capability ships, or "
- "remove the underlying rows out-of-band, before deleting the "
- "database."
+ "soft-deleted. Purge each one first — GET "
+ "/api/v1/dataset/<uuid>/purge-impact for its impact token, then "
+ "POST /api/v1/dataset/<uuid>/purge with "
+ '{"confirmed_impact_token": <token>} — or restore them '
+ "(POST /api/v1/dataset/<uuid>/restore) if they should live on, "
+ "before deleting the database."
Review Comment:
Verified at this head: after a restore, `delete.py:80` takes the `has_live`
branch and raises `DatabaseDeleteDatasetsExistFailedError` — "Cannot delete a
database that has datasets attached". Restore swaps one 422 for another, so
"before deleting the database" doesn't hold on that branch.
```suggestion
'{"confirmed_impact_token": <token>} — before deleting the '
"database. Restoring them (POST /api/v1/dataset/<uuid>/restore) "
"keeps the datasets, but the database still cannot be deleted."
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]