Skip to content

Commit 144a8f4

Browse files
authored
Merge pull request #245 from mrshu/mrshu/use-boto3-default-session
_utils: Make sure boto3's default session is used
2 parents 4347d57 + c8ea710 commit 144a8f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

awswrangler/_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ def ensure_session(session: Optional[boto3.Session] = None) -> boto3.Session:
2121
"""Ensure that a valid boto3.Session will be returned."""
2222
if session is not None:
2323
return session
24-
return boto3.Session()
24+
# Ensure the boto3's default session is used so that its parameters can be
25+
# set via boto3.setup_default_session()
26+
return boto3._get_default_session() # pylint: disable=protected-access
2527

2628

2729
def client(service_name: str, session: Optional[boto3.Session] = None) -> boto3.client:

0 commit comments

Comments
 (0)