datajoint-python
datajoint-python copied to clipboard
Underscores allowed in class names
trafficstars
Bug Report
Description
https://docs.datajoint.org/python/definition/02-Creating-Tables.html#valid-class-names says that class names must:
contain only alphanumerical characters (no underscores).
However, I can create a DataJoint class with underscores without error.
@schema
class This_is_a_Test(dj.Manual):
definition = """
id: int
---
"""
Interestingly, this creates a MySQL table named "this_is_a__test_test".
Is this a bug? If so, then I think in
https://github.com/datajoint/datajoint-python/blob/master/datajoint/utils.py#L85
the re.match should be changed to re.fullmatch.
Reproducibility
MacOS, Python, DataJoint 0.13.8
Good catch. You are right. Let's fix.