Skip to content

Commit

Permalink
fix error message and release date
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitri-yatsenko committed Feb 7, 2019
1 parent 0826d94 commit fb14029
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 3 additions & 4 deletions datajoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
http://dx.doi.org/10.1101/031658
"""

__author__ = "Dimitri Yatsenko, Edgar Y. Walker, and Fabian Sinz at Baylor College of Medicine"
__date__ = "January 14, 2018"
__author__ = "DataJoint Contributors"
__date__ = "February 7, 2019"
__all__ = ['__author__', '__version__',
'config', 'conn', 'Connection',
'schema', 'create_virtual_module', 'get_schema_names',
Expand All @@ -26,7 +26,6 @@
'DataJointError', 'DuplicateError', 'key']


# ------------- flatten import hierarchy -------------------------
from .version import __version__
from .settings import config
from .connection import conn, Connection
Expand All @@ -38,4 +37,4 @@
from .erd import ERD
from .admin import set_password, kill
from .errors import DataJointError, DuplicateError
from .fetch import key
from .fetch import key
6 changes: 2 additions & 4 deletions datajoint/declare.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,12 +285,10 @@ def compile_attribute(line, in_key, foreign_key_sql):
else:
if match['default']:
quote = match['default'].upper() not in literals and match['default'][0] not in '"\''
match['default'] = ('NOT NULL DEFAULT ' +
('"%s"' if quote else "%s") % match['default'])
match['default'] = 'NOT NULL DEFAULT ' + ('"%s"' if quote else "%s") % match['default']
else:
match['default'] = 'NOT NULL'
match['comment'] = match['comment'].replace('"', '\\"') # escape double quotes in comment

is_configurable = match['type'].startswith(('external', 'blob-', 'attach'))
is_external = False
if is_configurable:
Expand All @@ -299,7 +297,7 @@ def compile_attribute(line, in_key, foreign_key_sql):
match['comment'] = ':{type}:{comment}'.format(**match) # insert configurable type into comment
store_name = match['type'].split('-')
if store_name[0] not in ('external', 'blob', 'attach'):
raise DataJointError('Invalid attribute type in:\n%s' % line)
raise DataJointError('Configurable types must be in the form blob-<store> or attach-<store> in:\n%s' % line)
store_name = '-'.join(store_name[1:])
if store_name and not store_name.isidentifier():
raise DataJointError(
Expand Down

0 comments on commit fb14029

Please sign in to comment.