Skip to content

Commit 0603547

Browse files
committed
fix: use session factory
1 parent 278d8f5 commit 0603547

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

awswrangler/opensearch/_write.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,9 @@ def index_json(
334334
"""
335335
_logger.debug("indexing %s from %s", index, path)
336336

337-
if boto3_session is None:
338-
raise ValueError("boto3_session cannot be None")
339-
340337
if path.startswith("s3://"):
341338
bucket, key = parse_path(path)
342-
s3 = boto3_session.client("s3")
339+
s3 = _utils.client(service_name="s3", session=boto3_session)
343340
obj = s3.get_object(Bucket=bucket, Key=key)
344341
body = obj["Body"].read()
345342
lines = body.splitlines()

0 commit comments

Comments
 (0)