Skip to content

docs(semantic-matching): unrelated namesakes, not missing lineage - #305

Open
dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/semantic-matching-unrelated-namesakes
Open

dimitri-yatsenko wants to merge 1 commit into
mainfrom
docs/semantic-matching-unrelated-namesakes

Conversation

@dimitri-yatsenko

Copy link
Copy Markdown
Member

Docs for datajoint/datajoint-python#1640 and its fix, datajoint/datajoint-python#1642.

Lineage follows foreign keys: a table's native primary-key attributes start it, and foreign keys pass it on. An attribute that no foreign key brings in has none: a native secondary attribute, an attribute computed in a projection, or a key that dj.U promotes. A join on two such namesakes is refused as a join on unrelated attributes, not as missing lineage.

  • Explanation, semantic-matching.md:
    • The lineage rules say where lineage comes from, and add keys promoted by dj.U.
    • The matching rule "either lineage is null → cannot verify homology" now reads as unrelated namesakes.
    • A new section, "Joining on unrelated namesakes", shows the error with two tables that each declare input_hash, and how to rename or exclude it.
    • The page no longer sends users to rebuild_lineage() for this error.
  • Spec, reference/specs/semantic-matching.md:
    • The "Raises" lines and the lineage-population notes now cover attributes with no lineage.
    • Both new messages are documented under Error Messages, marked "Changed in 2.4".
  • Union, corrected in both pages. The pages said union requires matching lineage. Union never compares lineage: it requires the same primary key and no secondary attribute in common. The docs now say what the code does.

Merge with or after datajoint/datajoint-python#1642.

Lineage follows foreign keys, so an attribute that no foreign key brings in (a native secondary attribute, a computed attribute, or a key promoted by dj.U) has none, and a join on two such namesakes is refused as a join on unrelated attributes. The explanation and the spec now say so, show the new messages, and no longer send users to rebuild_lineage() for this error. The union rule is corrected to what DataJoint checks: the same primary key and no secondary attribute in common.
@dimitri-yatsenko dimitri-yatsenko added the documentation Improvements or additions to documentation label Oct 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant