Repository navigation
docs(integrity): stable and injective identification, inherited identity, cascade of whole entities - #321
Open
dimitri-yatsenko wants to merge 10 commits into
Open
docs(integrity): stable and injective identification, inherited identity, cascade of whole entities#321dimitri-yatsenko wants to merge 10 commits into
dimitri-yatsenko wants to merge 10 commits into
Conversation
…ion must be stable and injective State the two properties the identification process needs, add inherited identity for tables whose key is inherited whole and for autopopulated tables, and recast partial entity integrity as the choice of the entity type a table represents. The primary-key how-to states the same split.
… a later table Quote the workflow normalization principle in its current wording, drop the claims that the lenses converge and that the workflow lens is the strictest, replace nullable removal dates with a later table, key the order by order_id alone, and scope update1 to rows nothing depends on.
…est rests on the library and on process Replace the unbypassable claim, state cascade as removal of everything downstream with master-part entities kept whole, and describe populate() as filling one table.
…aster-part entities whole Describe part_integrity for deletes that reach a part, retitle the update effect as rows not edited in place with what update1() does, and say that populate() is called per table.
… members take keys from make() - entity-integrity: an autopopulated master and any table keyed whole by a parent take identity from upstream; members of an autopopulated master's parts are identified by the keys make() assigns. - data-integrity, referential-integrity: define downstream with master-part entities, subject to the part_integrity mode; note that the default check compares tables; failed make() keys are held in an error state under job reservation. - normalization: null covers "does not apply"; group assignments end only by a GroupRemoval row; drop filler. - norm-mouse-housing.svg, norm-order-workflow.svg: hover titles match the edited definitions (no removal_date; order_date is a secondary attribute).
…ity inherited from one parent; group in the assignment key
This was referenced Nov 28, 2026
datajoint-python#1764 checks rows and refuses before deleting, so drop "the default check compares tables, not rows" and add a Changed in 2.3.7 note on both pages.
Member
Author
|
Updated for datajoint/datajoint-python#1764, now merged: main merged in, and data-integrity.md and referential-integrity.md no longer say the default check compares tables rather than rows. Each now says the check refuses before anything is deleted, with a "Changed in 2.3.7" note on the old behavior (same wording style as delete-data.md from docs#312). Ready for review. |
Member
Author
|
Two more fixes (2f38277): |
dimitri-yatsenko
requested review from
MilagrosMarin,
lum-agilyti and
ttngu207
December 1, 2026 23:18
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.
Integrity and normalization pages: identification, inherited identity, cascade
Corrects five pages where they misstated the relational workflow model, in each case to text that matches what the released library does (checked against datajoint-python
masterand v2.3.6). Tier names stay Manual / Imported / Computed here.explanation/normalization.mdsrc/was on the same page and is updated.Payment,Shipment, andDeliveryread as three entity types. A new paragraph says an entity type can be split across steps and that the tables share its identity, and the order example says the four tables are one entity type keyed byorder_id.removal_date=null : dateinCageAssignment(under "Fully normalized (correct)") and inGroupAssignment. Says:CageAssignmenthas no end date, since a move is a new assignment;GroupAssignmentis followed by a later table,GroupRemoval, and the assignments in force areGroupAssignment - GroupRemoval. Why: a null that means "not yet" needs an update to fill, which fails the page's own UPDATE test. The page now states the one meaning of null: the value was not provided when the row was created.order_datemoves below the---inOrder. With the date in the key, the same order entered under two dates is two entities, and the three later tables inherit a two-attribute key; the page's table already marked onlyorder_idas the key.update1()only "when nothing downstream depends on the attribute being changed". Says: only in a row that nothing depends on, directly or as a part of a master that something depends on, andupdate1()does not look for dependent rows. Why: a computation reads the whole parent row, and the library checks only that the row exists.AnalysisParamsgainscontents, so the "versioned configurations" example declares its rows; the Lookup lead says the rows incontentsare part of the schema definition.explanation/entity-integrity.mdmake()assigns distinct keys to the distinct members it produces.Accounttable has full entity integrity for accounts; a person is a different entity type that it does not identify. Why: the model defines only the two-way correspondence. The#partial-entity-integrityfragment is gone; nothing insrc/links to it.SubjectProfileis "at most one profile per subject", since nothing requires a profile to exist.explanation/data-integrity.mdmake()contract. Why: the page itself says Manual master-part atomicity is a convention and that identification is a real-world process, and the library offersallow_direct_insert=Trueandpart_integrity="ignore".part_integrity="cascade"extends it to the master and all of its parts. Cascade in the referential section is stated as everything downstream.populate()walks this graph". Says: each table'spopulate()computes the keys whose upstream rows exist, so populating the tables in dependency order completes the workflow. Why:populate()is a method of one table.explanation/referential-integrity.mdpart_integrity="enforce"and extends to the whole master-part entity under"cascade". A child that is not a part can always be deleted without its parent. The default check compares tables, not rows; the cascade specification lists what it misses.update1()never changes a primary-key value, can change a secondary foreign key, and does not look for dependents. Why: the old claim was untrue for secondary foreign keys (table.pybuilds theSETlist from every non-key attribute). The#4-update-restriction-on-key-valuesfragment is gone; nothing insrc/links to it.populate()on each table.how-to/design-primary-keys.mdLeft for the library
These statements stay as written, because the library behaves differently from the model and the docs follow the library:
entity-integrity.md,data-integrity.md). The library acceptsauto_incrementandserialin a key (declare.py:68) and a constant default on a key attribute (declare.py:1241-1262).data-integrity.md, "by convention" for Manual masters). The direct-insert guard covers autopopulated masters only (table.py:874,autopopulate.py:105); a part of any master accepts inserts outside its master's transaction.part_integrity="enforce"post-check is per table, not per row (table.py:1209-1221), as the cascade specification's Limitations section records.update1()does not refuse a row that has dependents (table.py:598-611).entity-integrity.md).key_sourcecan be overridden to change granularity (autopopulate.py:247), andjobs.allow_new_pk_fields_in_computed_tablesskips the no-new-key check (autopopulate.py:214).contentsrows are inserted only whencontentsis longer than the table, existing rows are never removed or changed, and runtime inserts are accepted (schemas.py:330-340).Open
relational-workflow-model.mdstill quotes the earlier wording of the workflow normalization principle.Checks
mkdocs build --strict,scripts/check_links.pyon the built site,scripts/check_markdown_lists.py, and codespell pass. markdownlint reports the same two unlabelled code fences as onmain.