Feat: Add destroy command to remove entire project resources#4328
Merged
themisvaltinos merged 3 commits intomainfrom May 9, 2025
Merged
Feat: Add destroy command to remove entire project resources#4328themisvaltinos merged 3 commits intomainfrom
themisvaltinos merged 3 commits intomainfrom
Conversation
87164cc to
1997df6
Compare
izeigerman
reviewed
May 7, 2025
sqlmesh/core/context.py
Outdated
| @python_api_analytics | ||
| def invalidate_environment(self, name: str, sync: bool = False) -> None: | ||
| def invalidate_environment( | ||
| self, name: str, sync: bool = False, protect_prod: t.Optional[bool] = True |
Member
There was a problem hiding this comment.
I don't think this should be in the public API of the context. If you want to reuse the method I suggest having a shared private method instead.
Contributor
Author
There was a problem hiding this comment.
yes good point actually only the invalidate method is used from it too so no need to call this
izeigerman
reviewed
May 7, 2025
izeigerman
reviewed
May 7, 2025
| ) | ||
|
|
||
| def invalidate_environment(self, name: str) -> None: | ||
| def invalidate_environment(self, name: str, protect_prod: t.Optional[bool] = True) -> None: |
Member
There was a problem hiding this comment.
ditto: why the new argument is optional?
Contributor
Author
There was a problem hiding this comment.
right my bad no need for it
1997df6 to
822a85f
Compare
georgesittas
approved these changes
May 8, 2025
Contributor
georgesittas
left a comment
There was a problem hiding this comment.
LGTM, just one question related to backup tables.
sqlmesh/core/context.py
Outdated
| name: The name of the environment to invalidate. | ||
| sync: If True, the call blocks until the environment is deleted. Otherwise, the environment will | ||
| be deleted asynchronously by the janitor process. | ||
| protect_prod: If True, prevents invalidation of the production environment. |
Contributor
Author
There was a problem hiding this comment.
good catch! thanks
822a85f to
c0e81b9
Compare
izeigerman
approved these changes
May 9, 2025
c0e81b9 to
20d72b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This update introduces the
sqlmesh destroycommand, which permanently deletes all engine-managed objects, including warehouse data, the associated state tables and cached SQLMesh assets, effectively resetting the entire project, fixes: #3684Usage:
sqlmesh destroyThis might be useful for cleaning up development projects, proof-of-concept work or pre-production phases with temporary setups.