Skip to content

Commit b1ac098

Browse files
author
Chris Turner
authored
Merge pull request #676 from datajoint/master
Incorporate latest HotFixes into dev
2 parents 786253a + 15b9b61 commit b1ac098

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

datajoint/blob.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import numpy as np
1313
from .errors import DataJointError
1414
from .utils import OrderedDict
15+
from .settings import config
1516

1617

1718
mxClassID = OrderedDict((
@@ -71,6 +72,9 @@ def __init__(self, squeeze=False):
7172
self.protocol = None
7273

7374
def set_dj0(self):
75+
if not config.get('enable_python_native_blobs'):
76+
raise DataJointError('v0.12+ python native blobs disabled. see also: https://github.com/datajoint/datajoint-python/blob/master/README.md')
77+
7478
self.protocol = b"dj0\0" # when using new blob features
7579

7680
def squeeze(self, array, convert_to_scalar=True):

datajoint/s3.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ class Folder:
1313
"""
1414
A Folder instance manipulates a flat folder of objects within an S3-compatible object store
1515
"""
16-
def __init__(self, endpoint, bucket, access_key, secret_key, **_):
17-
self.client = minio.Minio(endpoint, access_key=access_key, secret_key=secret_key, secure=False)
16+
def __init__(self, endpoint, bucket, access_key, secret_key, *, secure=False, **_):
17+
self.client = minio.Minio(endpoint, access_key=access_key, secret_key=secret_key, secure=secure)
1818
self.bucket = bucket
1919
if not self.client.bucket_exists(bucket):
2020
warnings.warn('Creating bucket "%s"' % self.bucket)

datajoint/settings.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@
4343
'display.limit': 12,
4444
'display.width': 14,
4545
'display.show_tuple_count': True,
46-
'database.use_tls': None
46+
'database.use_tls': None,
47+
'enable_python_native_blobs': False, # python-native/dj0 encoding support
4748
})
4849

4950
logger = logging.getLogger(__name__)
@@ -136,7 +137,7 @@ def get_store_spec(self, store):
136137
spec['subfolding'] = spec.get('subfolding', DEFAULT_SUBFOLDING)
137138
spec_keys = { # REQUIRED in uppercase and allowed in lowercase
138139
'file': ('PROTOCOL', 'LOCATION', 'subfolding', 'stage'),
139-
's3': ('PROTOCOL', 'ENDPOINT', 'BUCKET', 'ACCESS_KEY', 'SECRET_KEY', 'LOCATION', 'subfolding', 'stage')}
140+
's3': ('PROTOCOL', 'ENDPOINT', 'BUCKET', 'ACCESS_KEY', 'SECRET_KEY', 'LOCATION', 'secure', 'subfolding', 'stage')}
140141

141142
try:
142143
spec_keys = spec_keys[spec.get('protocol', '').lower()]
@@ -146,7 +147,7 @@ def get_store_spec(self, store):
146147

147148
# check that all required keys are present in spec
148149
try:
149-
raise DataJointError('dj.config["stores"]["{store}" is missing "{k}"'.format(
150+
raise DataJointError('dj.config["stores"]["{store}"] is missing "{k}"'.format(
150151
store=store, k=next(k.lower() for k in spec_keys if k.isupper() and k.lower() not in spec)))
151152
except StopIteration:
152153
pass

0 commit comments

Comments
 (0)