Skip to content

Commit 054ea2e

Browse files
committed
enh: introduce enable_basins in s3cc.get_s3_dc_handle
1 parent 5a09938 commit 054ea2e

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
1.0.4
2+
- enh: introduce `enable_basins` in `s3cc.get_s3_dc_handle`
13
1.0.3
24
- enh: allow to specify resource name when creating test resource
35
1.0.2

dcor_shared/s3cc.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,19 @@ def get_s3_bucket_name_for_resource(resource_id):
188188

189189
def get_s3_dc_handle(
190190
resource_id: str,
191-
artifact: Literal["condensed", "preview", "resource"] = "resource"):
191+
artifact: Literal["condensed", "preview", "resource"] = "resource",
192+
enable_basins: bool = False,
193+
):
192194
"""Return an instance of :class:`RTDC_S3`
193195
194196
The data are accessed directly via S3 using DCOR's access credentials.
195197
Use this if you need to access the original raw file.
196198
199+
If you set `enable_basins` to True, basins of the data on S3 will
200+
be considered. This is turned off for performance reasons. Note that
201+
since an instance of `RTDC_S3` is returned, no local basins are
202+
allowed.
203+
197204
The resource with the identifier `resource_id` must exist in the
198205
CKAN database.
199206
"""
@@ -204,9 +211,7 @@ def get_s3_dc_handle(
204211
"dcor_object_store.access_key_id"),
205212
secret_access_key=get_ckan_config_option(
206213
"dcor_object_store.secret_access_key"),
207-
# Disable basins, because they could point to files on the
208-
# local file system (security).
209-
enable_basins=False,
214+
enable_basins=enable_basins,
210215
)
211216
return ds
212217

0 commit comments

Comments
 (0)