Skip to content

Commit 260b532

Browse files
authored
Merge pull request #448 from dimitri-yatsenko/master
Fix #438 - raise an error when calling populate on a restricted table
2 parents 07ffd36 + 40b38d9 commit 260b532

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

datajoint/autopopulate.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def _jobs_to_do(self, restrictions):
6969
"""
7070
:return: the relation containing the keys to be computed (derived from self.key_source)
7171
"""
72+
if self.restriction:
73+
raise DataJointError('Cannot call populate on a restricted table. '
74+
'Instead, pass conditions to populate() as arguments.')
7275
todo = self.key_source
7376
if not isinstance(todo, RelationalOperand):
7477
raise DataJointError('Invalid key_source value')

datajoint/user_relations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# attributes that trigger instantiation of user classes
1414
supported_class_attrs = set((
15-
'key_source', 'describe', 'populate', 'progress',
15+
'key_source', 'describe', 'populate', 'progress', 'primary_key',
1616
'proj', 'aggr', 'heading', 'fetch', 'fetch1',
1717
'insert', 'insert1', 'drop', 'drop_quick',
1818
'delete', 'delete_quick'))

0 commit comments

Comments
 (0)