Skip to content

Commit 7c02ec4

Browse files
committed
switch to updating the default session
1 parent 66c27c3 commit 7c02ec4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

target_s3_parquet/sinks.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from typing import Dict, List, Optional
55
import awswrangler as wr
6-
from boto3.session import Session
6+
from boto3 import setup_default_session
77
from pandas import DataFrame
88
from singer_sdk import Target
99
from singer_sdk.sinks import BatchSink
@@ -36,10 +36,11 @@ def __init__(
3636
) -> None:
3737
super().__init__(target, stream_name, schema, key_properties)
3838

39-
self._session = Session() if self._is_using_hmac() else Session(
40-
aws_access_key_id=self.config.get("aws_access_key_id"),
41-
aws_secret_access_key=self.config.get("aws_secret_access_key"),
42-
)
39+
if self._is_using_hmac():
40+
setup_default_session(
41+
aws_access_key_id=self.config.get("aws_access_key_id"),
42+
aws_secret_access_key=self.config.get("aws_secret_access_key"),
43+
)
4344

4445
self._glue_schema = self._get_glue_schema()
4546

@@ -102,7 +103,6 @@ def process_batch(self, context: dict) -> None:
102103
partition_cols=["_sdc_started_at"],
103104
schema_evolution=True,
104105
dtype=dtype,
105-
boto3_session=self._session,
106106
)
107107

108108
self.logger.info(f"Uploaded {len(context['records'])}")

0 commit comments

Comments
 (0)