Chore: Show resources to be deleted and enhance warnings in destroy#4965
Chore: Show resources to be deleted and enhance warnings in destroy#4965themisvaltinos merged 4 commits intomainfrom
Conversation
|
we don't need two prompts, just one is enough. oh was it already like this before? |
sqlmesh/core/console.py
Outdated
| ( | ||
| "This will permanently delete all engine-managed objects, state tables and SQLMesh cache.\n" | ||
| "!!! EXTREME CAUTION: DESTRUCTIVE OPERATION !!!\n\n" | ||
| "The 'destroy' command will PERMANENTLY DELETE:\n" |
There was a problem hiding this comment.
it's not necessary permament if you have other mechanisms to recover, so i wouldn't say that
no it was originally just one, I added the second prompt for extra safety, but I’ve now revised it back to a single prompt shown after listing everything that will be deleted |
|
@themisvaltinos Thank you for putting this together and very helpful. It would be good to be able to show what objects will be deleted before the confirmation, so that the user can see the list before they confirm with "Y". |
Ah, I see in the screenshot you have posted. The user needs to confirm twice - please ignore my above comment! |
a776ed1 to
697ca85
Compare
| 'Deleted object "memory"."raw"."model1"', | ||
| 'Deleted object "memory"."raw"."model2"', | ||
| 'Deleted object "memory"."raw"."model2"', | ||
| 'Deleted object "memory"."raw"."demographics"', |
There was a problem hiding this comment.
Curious why memory.raw.demographics no longer shows up
There was a problem hiding this comment.
good point it still shows up this simply checks parts of the output but I added it back as well in the assertions
cb196c7 to
c25f611
Compare
This enhances the warning of the sqlmesh destroy command and lists the resources to be deleted before re-prompting the user to further confirm, fixes: #4960
Updated version: