|
3 | 3 |
|
4 | 4 | from typing import Dict, List, Optional
|
5 | 5 | import awswrangler as wr
|
6 |
| -from boto3.session import Session |
| 6 | +from boto3 import setup_default_session |
7 | 7 | from pandas import DataFrame
|
8 | 8 | from singer_sdk import Target
|
9 | 9 | from singer_sdk.sinks import BatchSink
|
@@ -36,10 +36,11 @@ def __init__(
|
36 | 36 | ) -> None:
|
37 | 37 | super().__init__(target, stream_name, schema, key_properties)
|
38 | 38 |
|
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 | + ) |
43 | 44 |
|
44 | 45 | self._glue_schema = self._get_glue_schema()
|
45 | 46 |
|
@@ -102,7 +103,6 @@ def process_batch(self, context: dict) -> None:
|
102 | 103 | partition_cols=["_sdc_started_at"],
|
103 | 104 | schema_evolution=True,
|
104 | 105 | dtype=dtype,
|
105 |
| - boto3_session=self._session, |
106 | 106 | )
|
107 | 107 |
|
108 | 108 | self.logger.info(f"Uploaded {len(context['records'])}")
|
|
0 commit comments