Repository: datajoint/datajoint-python (language: python)

Issue:
Key populate
Work in progress to address performance issues with `populate` calls due to excessively long `key_source` queries.


Discussion / hints:

Fix patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 05bfcabd..f22d4825 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,7 @@
 - Added - `dj.Top` restriction ([#1024](https://github.com/datajoint/datajoint-python/issues/1024)) PR [#1084](https://github.com/datajoint/datajoint-python/pull/1084)
 - Fixed - Added encapsulating double quotes to comply with [DOT language](https://graphviz.org/doc/info/lang.html) - PR [#1177](https://github.com/datajoint/datajoint-python/pull/1177)
 - Added - Ability to set hidden attributes on a table - PR [#1091](https://github.com/datajoint/datajoint-python/pull/1091)
+- Added - Ability to specify a list of keys to popuate - PR [#989](https://github.com/datajoint/datajoint-python/pull/989)
 
 ### 0.14.2 -- Aug 19, 2024
 - Added - Migrate nosetests to pytest - PR [#1142](https://github.com/datajoint/datajoint-python/pull/1142)


Test patch:
diff --git a/tests/test_autopopulate.py b/tests/test_autopopulate.py
index d1f0726e..580fb406 100644
--- a/tests/test_autopopulate.py
+++ b/tests/test_autopopulate.py
@@ -49,6 +49,18 @@ def test_populate_with_success_count(subject, experiment, trial):
     assert len(trial.key_source & trial) == success_count
 
 
+def test_populate_key_list(subject, experiment, trial):
+    # test simple populate
+    assert subject, "root tables are empty"
+    assert not experiment, "table already filled?"
+    keys = experiment.key_source.fetch("KEY", order_by="KEY")
+    n = 3
+    assert len(keys) > n
+    keys = keys[:n]
+    ret = experiment.populate(keys=keys)
+    assert n == ret["success_count"]
+
+
 def test_populate_exclude_error_and_ignore_jobs(schema_any, subject, experiment):
     # test simple populate
     assert subject, "root tables are empty"