Repository navigation
Delete: prompt=True for development; preview, then delete(prompt=False) in production - #312
Open
dimitri-yatsenko wants to merge 1 commit into
Open
dimitri-yatsenko wants to merge 1 commit into
dimitri-yatsenko wants to merge 1 commit into
Conversation
…oduction delete(prompt=True) asks for confirmation while the delete transaction is still open, so it is meant for interactive development. In production, preview with dj.Diagram.cascade(...) using the same part_integrity, then call delete(prompt=False). Update the delete how-to (including iterating the cascade to see the rows), the data manipulation spec (sections 4.4, 4.5, and 9.5), the transactions explanation, the data entry tutorial's best practice, and add a current-guidance note to the 2.2 release notes. Refs datajoint/datajoint-python#1682
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
November 18, 2026 20:15
This branch has not been deployed
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.
Documents the decision on datajoint/datajoint-python#1682:
delete()keeps its behavior,prompt=Trueis for interactive development and prototyping, and production code previews the delete and then callsdelete(prompt=False). Matches thedelete()docstring change in datajoint/datajoint-python#1690.Diagram.cascade().counts(), thendelete(prompt=False), with the samepart_integrity). "Inspecting Cascade Before Deleting" adds iterating the cascade to see the rows. The transaction-handling notes say thattransaction=Falseasks no confirmation and does not roll back.transaction=Falseis needed, and what it means.prompt=False.Every statement and code example was checked against MySQL and PostgreSQL.
mkdocs build --strict, the link check and codespell pass.