datajoint-python
datajoint-python copied to clipboard
`.parts` not always returning parts
Bug Report
Description
Sometimes the .parts
property on tables returns an empty list even if the table has parts.
@schema
class MyTable(dj.Manual):
definition = """
a: int
---
b: int
"""
class MyFirstPart(dj.Part):
definition = """
-> master
---
c: int
"""
class MySecondPart(dj.Part):
definition = """
-> master
---
d: int
"""
# MyTable().connection.dependencies.load() # Uncommenting this fixes the problem
assert MyTable().parts(as_objects=True) is [] # Should error but doesn't
Reproducibility
- LINUX
- Python 3.8
- DataJoint Version 0.12.9
Thanks for the report @cblessing24. I was able to replicate this issue in DataJoint Python version 0.14.1.
@dimitri-yatsenko Would you suggest that I add the following line to the parts method? Or is there a different issue going on? Thanks.
self.connection.dependencies.load()
looking into this. Yes it appears that the function assumes that the dependencies have been loaded.