Skip to content

Commit e304660

Browse files
Merge pull request #1510 from MilagrosMarin/docs/autopopulate-upstream-drift
docs(autopopulate): fix stale finally-comment; document upstream in class Attributes
2 parents 1d880ce + f39eca5 commit e304660

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

src/datajoint/autopopulate.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class AutoPopulate:
8989
Query yielding keys to be populated. Default is join of FK parents.
9090
jobs : Job
9191
Job table (``~~table_name``) for distributed processing.
92+
upstream : Diagram
93+
Pre-restricted ancestor view for the current ``make(self, key)`` call
94+
(property). Available only inside ``make()``; built lazily on first
95+
access and memoized for the call. See the property docstring for
96+
details.
9297
9398
Notes
9499
-----
@@ -736,9 +741,11 @@ def _populate1(
736741
return True
737742
finally:
738743
self.__class__._allow_insert = False
739-
# Clear the per-make() upstream view so subsequent attribute
740-
# access raises a clear error rather than silently using a
741-
# stale trace from the previous make() call.
744+
# Clear the per-make() upstream state: `_upstream = None` invalidates
745+
# the memoized Diagram; `_upstream_key = None` restores the "outside
746+
# make()" state so subsequent `self.upstream` access raises a clear
747+
# error via the property guard rather than silently returning a stale
748+
# trace from the previous call.
742749
self._upstream = None
743750
self._upstream_key = None
744751

0 commit comments

Comments
 (0)