From fb140299db6140415bfe1f41ec715c2e4a5decd2 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Thu, 7 Feb 2019 15:30:34 -0600 Subject: [PATCH] fix error message and release date --- datajoint/__init__.py | 7 +++---- datajoint/declare.py | 6 ++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/datajoint/__init__.py b/datajoint/__init__.py index 6a1d27886..9e98ba31b 100644 --- a/datajoint/__init__.py +++ b/datajoint/__init__.py @@ -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', @@ -26,7 +26,6 @@ 'DataJointError', 'DuplicateError', 'key'] -# ------------- flatten import hierarchy ------------------------- from .version import __version__ from .settings import config from .connection import conn, Connection @@ -38,4 +37,4 @@ from .erd import ERD from .admin import set_password, kill from .errors import DataJointError, DuplicateError -from .fetch import key \ No newline at end of file +from .fetch import key diff --git a/datajoint/declare.py b/datajoint/declare.py index 982198732..64b81c09d 100644 --- a/datajoint/declare.py +++ b/datajoint/declare.py @@ -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: @@ -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- or attach- in:\n%s' % line) store_name = '-'.join(store_name[1:]) if store_name and not store_name.isidentifier(): raise DataJointError(