docs(autopopulate): fix stale finally-comment; document upstream in class Attributes#1510
Merged
MilagrosMarin merged 1 commit intoJul 20, 2026
Conversation
…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.
dimitri-yatsenko
approved these changes
Jul 20, 2026
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.
Two post-#1499 documentation drift fixes on
src/datajoint/autopopulate.py.Changes
1.
_populate_onefinally-block comment — the comment above the state cleanup attributed the "raises a clear error rather than silently using a stale trace" behavior toself._upstream = None, but after #1499 that line only invalidates the memoizedDiagram. The actual guard isself._upstream_key = None(via theupstreamproperty 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 behaviorA maintainer who trusted the old comment might remove
_upstream_key = Noneon the assumption_upstream = Nonewas sufficient — exactly the silent-stale-trace outcome the comment warns against.2.
AutoPopulateclass docstring — the Attributes section listedkey_sourceandjobsbut omittedupstream, which is a public@propertysince #1473 (documented at:103-141as 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. Addedupstreamalongside the others.Docs-only, no behavior change.