File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ def unite_master_parts(lst):
26
26
# move from the ith position to the (j+1)th position
27
27
lst [j + 1 :i + 1 ] = [name ] + lst [j + 1 :i ]
28
28
break
29
- else :
30
- raise DataJointError ("Found a part table {name} without its master table." .format (name = name ))
31
29
return lst
32
30
33
31
Original file line number Diff line number Diff line change @@ -160,6 +160,37 @@ def test_dependencies():
160
160
assert_set_equal (set (s .full_table_name for s in channel .parents (primary = True , as_objects = True )),
161
161
{ephys .full_table_name })
162
162
163
+ @staticmethod
164
+ def test_descendants_only_contain_part_table ():
165
+ """issue #927"""
166
+
167
+ @schema
168
+ class A (dj .Manual ):
169
+ definition = """
170
+ a: int
171
+ """
172
+
173
+ @schema
174
+ class B (dj .Manual ):
175
+ definition = """
176
+ -> A
177
+ b: int
178
+ """
179
+
180
+ @schema
181
+ class Master (dj .Manual ):
182
+ definition = """
183
+ table_master: int
184
+ """
185
+
186
+ class Part (dj .Part ):
187
+ definition = """
188
+ -> master
189
+ -> B
190
+ """
191
+
192
+ assert A .descendants () == ['`djtest_test1`.`a`' , '`djtest_test1`.`b`' , '`djtest_test1`.`master__part`' ]
193
+
163
194
@staticmethod
164
195
@raises (dj .DataJointError )
165
196
def test_bad_attribute_name ():
You can’t perform that action at this time.
0 commit comments