From b38bd924cd86ee258a0513809fd958b6c310dad3 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Fri, 30 Jan 2026 10:02:03 -0600 Subject: [PATCH] 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 --- datajoint/autopopulate.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datajoint/autopopulate.py b/datajoint/autopopulate.py index 226e64dda..d696ce981 100644 --- a/datajoint/autopopulate.py +++ b/datajoint/autopopulate.py @@ -93,7 +93,7 @@ def _rename_attributes(table, props): self._key_source *= _rename_attributes(*q) return self._key_source - def make(self, key): + def make(self, key, **kwargs): """ This method must be implemented by derived classes to perform automated computation. The method must implement the following three steps: @@ -136,6 +136,8 @@ def make(self, key): DataJoint may programmatically enforce this separation in the future. :param key: The primary key value used to restrict the data fetching. + :param kwargs: Keyword arguments passed from populate(make_kwargs=...). + These are passed to make_fetch for the tripartite pattern. :raises NotImplementedError: If the derived class does not implement the required methods. """ @@ -153,7 +155,7 @@ def make(self, key): # User has implemented `_fetch`, `_compute`, and `_insert` methods instead # Step 1: Fetch data from parent tables - fetched_data = self.make_fetch(key) # fetched_data is a tuple + fetched_data = self.make_fetch(key, **kwargs) # fetched_data is a tuple computed_result = yield fetched_data # passed as input into make_compute # Step 2: If computed result is not passed in, compute the result