s3 listings were cached, preventing new datasets from being accessible (#1408)

Fixes #1407
This commit is contained in:
bmccandless
2020-04-17 10:14:24 -07:00
committed by GitHub
parent 58e4c2489b
commit 03a75ec566
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -42,8 +42,12 @@ class DataLocator:
self.cname = self.path if self.protocol == "file" else self.uri_or_path
# fsspec.filesystem will throw RuntimeError if the protocol is unsupported
if self.protocol == "s3" and region_name:
self.fs = fsspec.filesystem(self.protocol, config_kwargs={"region_name": region_name})
if self.protocol == "s3":
if region_name:
config_kwargs = dict(region_name=region_name)
self.fs = fsspec.filesystem(self.protocol, listings_expiry_time=30, config_kwargs=config_kwargs)
else:
self.fs = fsspec.filesystem(self.protocol, listings_expiry_time=30)
else:
self.fs = fsspec.filesystem(self.protocol)