Skip to content

docs(autopopulate): fix stale finally-comment; document upstream in class Attributes#1510

Merged
MilagrosMarin merged 1 commit into
datajoint:masterfrom
MilagrosMarin:docs/autopopulate-upstream-drift
Jul 20, 2026
Merged

docs(autopopulate): fix stale finally-comment; document upstream in class Attributes#1510
MilagrosMarin merged 1 commit into
datajoint:masterfrom
MilagrosMarin:docs/autopopulate-upstream-drift

Conversation

@MilagrosMarin

Copy link
Copy Markdown
Contributor

Two post-#1499 documentation drift fixes on src/datajoint/autopopulate.py.

Changes

1. _populate_one finally-block comment — the comment above the state cleanup attributed the "raises a clear error rather than silently using a stale trace" behavior to self._upstream = None, but after #1499 that line only invalidates the memoized Diagram. The actual guard is self._upstream_key = None (via the upstream property at :135-140, which raises when _upstream_key is None). Reworded so each line's role is correctly attributed:

  • _upstream = None → invalidates the memoized Diagram
  • _upstream_key = None → restores the "outside make()" state; enables the guard's clear-error behavior

A maintainer who trusted the old comment might remove _upstream_key = None on the assumption _upstream = None was sufficient — exactly the silent-stale-trace outcome the comment warns against.

2. AutoPopulate class docstring — the Attributes section listed key_source and jobs but omitted upstream, which is a public @property since #1473 (documented at :103-141 as the "recommended pattern for the make() reproducibility contract"). Sphinx renders the class docstring at the top of the AutoPopulate reference page, so readers of the summary see a Table+jobs mixin and miss the primary public read surface until they scroll to the property. Added upstream alongside the others.

Docs-only, no behavior change.

…lass Attributes

Two post-datajoint#1499 docstring/comment updates on autopopulate.py:

1. The finally-block comment in _populate_one attributed the 'raises a
   clear error' behavior to `self._upstream = None`, but post-datajoint#1499
   that line only invalidates the memoized Diagram. The actual guard
   is `self._upstream_key = None` (via the `upstream` property at
   :135-140). Reworded to attribute each line to its role.

2. AutoPopulate class docstring's Attributes section listed only
   `key_source` and `jobs`, omitting `upstream` - which after datajoint#1473 is
   a public property and the recommended read surface inside make().
   Added it alongside the others.

Docs-only.
@MilagrosMarin
MilagrosMarin merged commit e304660 into datajoint:master Jul 20, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants