File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 1313from awswrangler .aurora import Aurora # noqa
1414from awswrangler .emr import EMR # noqa
1515from awswrangler .sagemaker import SageMaker # noqa
16+ from awswrangler .dynamodb import DynamoDB # noqa
1617import awswrangler .utils # noqa
1718import awswrangler .data_types # noqa
1819
@@ -51,6 +52,7 @@ def __getattr__(self, name):
5152athena : Athena = DynamicInstantiate ("athena" , Athena ) # type: ignore
5253aurora : Aurora = DynamicInstantiate ("aurora" , Aurora ) # type: ignore
5354redshift : Redshift = DynamicInstantiate ("redshift" , Redshift ) # type: ignore
55+ dynamodb : DynamoDB = DynamicInstantiate ("dynamodb" , DynamoDB ) # type: ignore
5456sagemaker : SageMaker = DynamicInstantiate ("sagemaker" , SageMaker ) # type: ignore
5557cloudwatchlogs : CloudWatchLogs = DynamicInstantiate ("cloudwatchlogs" , CloudWatchLogs ) # type: ignore
5658
Original file line number Diff line number Diff line change 1+ from typing import TYPE_CHECKING
2+ from logging import getLogger , Logger
3+
4+ from boto3 import client # type: ignore
5+
6+ if TYPE_CHECKING :
7+ from awswrangler .session import Session
8+
9+ logger : Logger = getLogger (__name__ )
10+
11+
12+ class DynamoDB :
13+ def __init__ (self , session : "Session" ):
14+ self ._session : "Session" = session
15+ self ._client_dynamodb : client = session .boto3_session .client (service_name = "dynamodb" ,
16+ use_ssl = True ,
17+ config = session .botocore_config )
Original file line number Diff line number Diff line change 1515from awswrangler .aurora import Aurora
1616from awswrangler .emr import EMR
1717from awswrangler .sagemaker import SageMaker
18+ from awswrangler .dynamodb import DynamoDB
1819from awswrangler .exceptions import AWSCredentialsNotFound
1920
2021PYSPARK_INSTALLED : bool = False
@@ -120,6 +121,7 @@ def __init__(self,
120121 self ._aurora : Optional [Aurora ] = None
121122 self ._spark : Optional [Spark ] = None
122123 self ._sagemaker : Optional [SageMaker ] = None
124+ self ._dynamodb : Optional [DynamoDB ] = None
123125
124126 def _load_new_boto3_session (self ) -> None :
125127 """
@@ -310,6 +312,12 @@ def sagemaker(self) -> SageMaker:
310312 self ._sagemaker = SageMaker (session = self )
311313 return self ._sagemaker
312314
315+ @property
316+ def dynamodb (self ) -> DynamoDB :
317+ if self ._dynamodb is None :
318+ self ._dynamodb = DynamoDB (session = self )
319+ return self ._dynamodb
320+
313321 @property
314322 def spark (self ):
315323 if PYSPARK_INSTALLED is False :
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ pytest-cov~=2.8.1
55scikit-learn ~= 0.22.1
66cfn-lint ~= 0.27.2
77twine ~= 3.1.1
8- wheel ~= 0.33.6
8+ wheel ~= 0.34.0
99sphinx ~= 2.3.1
1010pyspark ~= 2.4.4
1111pyspark-stubs ~= 2.4.0.post7
You can’t perform that action at this time.
0 commit comments