Skip to content

Commit ab27e97

Browse files
committed
add check before instating session
1 parent ff6dd9e commit ab27e97

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

jupyter_drives/manager.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ def __init__(self, config: traitlets.config.Config) -> None:
4242
self._content_managers = {}
4343
self._max_files_listed = 1000
4444

45-
# initiate aiobotocore session if we are dealing with S3 drives
45+
# initiate aiobotocore session if we are dealing with S3 drives
4646
if self._config.provider == 's3':
47-
self._s3_clients = {}
48-
self._s3_session = get_session()
47+
if self._config.access_key_id is not None and self._config.secret_access_key is not None:
48+
self._s3_clients = {}
49+
self._s3_session = get_session()
4950

5051
@property
5152
def base_api_url(self) -> str:

0 commit comments

Comments
 (0)