datajoint-python
datajoint-python copied to clipboard
Fix error when altering Part table that uses "master" keyword
Fix #936.
The core of the issue appears to be that the "master" keyword in the Part table definition does not match the name of a table in context
. So in this PR, I update alter
only for Part tables so that "master" refers to the master table in context
. There may be a more elegant way to fix this issue, but this seems to do the trick.
This solution does not handle the case of a part table using the "master" keyword in a more complex way, though.
@schema
class Probe(dj.Manual):
definition = """
id: int
"""
class Shank(dj.Part):
definition = """
-> master
"""
class Electrode(dj.Part):
definition = """
-> master.Shank
"""
Thanks for taking a look at this PR. This issue comes up in the Frank Lab often.
Syntax, integration, and style checks pass. Thanks for the comprehensive developer documentation!