datajoint-python
datajoint-python copied to clipboard
Multiple '---' in definition are allowed but can lead to confusion
trafficstars
Bug Report
Description
A user decides to include multiple lines beginning with '---' and no error was thrown while parsing. This can lead to confusion as user believes that this has been accepted as correct definition format. Expectation would be to throw an error so that user can be explicit in defining which are primary key attributes and which are secondary attributes.
Reproducibility
Include:
- OS: Linux
- Python Version: 3.8.1
- MySQL Version: 5.7
- MySQL Deployment Strategy: local-docker
- DataJoint Version: 0.12.7
- Steps:
import datajoint as dj schema = dj.Schema('test') @schema class Flight(dj.Manual): definition = """ flight_no : int --- economy_price : decimal(6,2) departure : datetime arrival : datetime --- origin_code : int dest_code : int """ print(Flight())
Expected Behavior
Expected to throw DataJointError error.