docs(trace): describe self.upstream as lazily built on first access#211
Merged
MilagrosMarin merged 1 commit intoJul 17, 2026
Merged
Conversation
Post-#1499 (v2.3.1), self.upstream is no longer constructed eagerly before make(). The framework records the key; Diagram.trace(self & key) is built the first time the user accesses self.upstream and memoized for the rest of the call. make() implementations that never read upstream pay nothing. Updates two lifecycle descriptions to match: - trace.md 'Where it's set' - autopopulate.md 4.4 Lifecycle / Lazy bullets Docs-only.
dimitri-yatsenko
approved these changes
Jul 17, 2026
dimitri-yatsenko
left a comment
Member
There was a problem hiding this comment.
LGTM. Accurately describes the lazy self.upstream behavior merged in #1499 — key recorded before make(), trace built on first access and memoized, never built if unused, cleared in finally.
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.
Post-#1499 (shipped in v2.3.1),
self.upstreamis no longer constructed eagerly before everymake()— the framework records the key, andDiagram.trace(self & key)is built the first time the user accessesself.upstreamand memoized for the rest of the call.make()implementations that never readself.upstreampay nothing.The shipped code (
src/datajoint/autopopulate.py:135-141,:673-674) and the release-notes performance highlight both describe this behavior, but two docs paragraphs still describe the pre-#1499 lifecycle.Changes
src/reference/specs/trace.md— §"Where it's set"self.upstream = Diagram.trace(self & key)immediately before invoking" → "records the current key but defers constructing the trace; built on first access, memoized for the rest of the call".src/reference/specs/autopopulate.md— §4.4self.upstreambehavior