Skip to content

Commit 16fdb0a

Browse files
committed
account for s3 gubbins
1 parent 33dae93 commit 16fdb0a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

activestorage/active.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,20 @@ def __init__(
173173
self.ds = dataset
174174
self.uri = dataset
175175

176-
# determine the storage type in the most generic way
176+
# determine the storage_type
177+
# based on what we have available
177178
if not storage_type:
178179
if not input_variable:
179180
check_uri = self.uri
180181
else:
181182
check_uri = self.ds.id._filename
183+
if storage_options is not None and 'client_kwargs' in storage_options:
184+
if "endpoint_url" in storage_options['client_kwargs']:
185+
base_url = storage_options['client_kwargs']["endpoint_url"]
186+
if not input_variable:
187+
check_uri = os.path.join(base_url, self.uri)
188+
else:
189+
check_uri = os.path.join(base_url, self.ds.id._filename)
182190
storage_type = return_storage_type(check_uri)
183191

184192
# still allow for a passable storage_type

0 commit comments

Comments
 (0)