Skip to content

Commit b38bd92

Browse files
fix: Pass make_kwargs to make_fetch in tripartite pattern
When using generator-based make (make_fetch, make_compute, make_insert), make_kwargs passed to populate() were not being forwarded to make_fetch. This caused TypeError when using make_kwargs with the tripartite pattern. Fixes #1350 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 701f5ad commit b38bd92

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

datajoint/autopopulate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def _rename_attributes(table, props):
9393
self._key_source *= _rename_attributes(*q)
9494
return self._key_source
9595

96-
def make(self, key):
96+
def make(self, key, **kwargs):
9797
"""
9898
This method must be implemented by derived classes to perform automated computation.
9999
The method must implement the following three steps:
@@ -136,6 +136,8 @@ def make(self, key):
136136
DataJoint may programmatically enforce this separation in the future.
137137
138138
:param key: The primary key value used to restrict the data fetching.
139+
:param kwargs: Keyword arguments passed from populate(make_kwargs=...).
140+
These are passed to make_fetch for the tripartite pattern.
139141
:raises NotImplementedError: If the derived class does not implement the required methods.
140142
"""
141143

@@ -153,7 +155,7 @@ def make(self, key):
153155
# User has implemented `_fetch`, `_compute`, and `_insert` methods instead
154156

155157
# Step 1: Fetch data from parent tables
156-
fetched_data = self.make_fetch(key) # fetched_data is a tuple
158+
fetched_data = self.make_fetch(key, **kwargs) # fetched_data is a tuple
157159
computed_result = yield fetched_data # passed as input into make_compute
158160

159161
# Step 2: If computed result is not passed in, compute the result

0 commit comments

Comments
 (0)