|
21 | 21 | from awswrangler.session import Session # noqa |
22 | 22 |
|
23 | 23 |
|
24 | | -class DynamicInstantiate: |
| 24 | +class _DynamicInstantiate: |
25 | 25 | """ |
26 | 26 | Class to instantiate the default Session. |
27 | 27 |
|
@@ -50,24 +50,24 @@ def __init__(self, module_name, class_ref): |
50 | 50 |
|
51 | 51 | def __getattr__(self, name): |
52 | 52 | """Override __getattr__.""" |
53 | | - if DynamicInstantiate.__default_session is None: |
54 | | - DynamicInstantiate.__default_session = Session() |
55 | | - return getattr(getattr(DynamicInstantiate.__default_session, self._module_name), name) |
| 53 | + if _DynamicInstantiate.__default_session is None: |
| 54 | + _DynamicInstantiate.__default_session = Session() |
| 55 | + return getattr(getattr(_DynamicInstantiate.__default_session, self._module_name), name) |
56 | 56 |
|
57 | 57 |
|
58 | 58 | if version_info < (3, 8) and importlib.util.find_spec("pyspark"): # type: ignore |
59 | 59 | from awswrangler.spark import Spark # noqa |
60 | | - spark: Spark = DynamicInstantiate("spark", Spark) # type: ignore |
| 60 | + spark: Spark = _DynamicInstantiate("spark", Spark) # type: ignore |
61 | 61 |
|
62 | | -s3: S3 = DynamicInstantiate("s3", S3) # type: ignore |
63 | | -emr: EMR = DynamicInstantiate("emr", EMR) # type: ignore |
64 | | -glue: Glue = DynamicInstantiate("glue", Glue) # type: ignore |
65 | | -pandas: Pandas = DynamicInstantiate("pandas", Pandas) # type: ignore |
66 | | -athena: Athena = DynamicInstantiate("athena", Athena) # type: ignore |
67 | | -aurora: Aurora = DynamicInstantiate("aurora", Aurora) # type: ignore |
68 | | -redshift: Redshift = DynamicInstantiate("redshift", Redshift) # type: ignore |
69 | | -dynamodb: DynamoDB = DynamicInstantiate("dynamodb", DynamoDB) # type: ignore |
70 | | -sagemaker: SageMaker = DynamicInstantiate("sagemaker", SageMaker) # type: ignore |
71 | | -cloudwatchlogs: CloudWatchLogs = DynamicInstantiate("cloudwatchlogs", CloudWatchLogs) # type: ignore |
| 62 | +s3: S3 = _DynamicInstantiate("s3", S3) # type: ignore |
| 63 | +emr: EMR = _DynamicInstantiate("emr", EMR) # type: ignore |
| 64 | +glue: Glue = _DynamicInstantiate("glue", Glue) # type: ignore |
| 65 | +pandas: Pandas = _DynamicInstantiate("pandas", Pandas) # type: ignore |
| 66 | +athena: Athena = _DynamicInstantiate("athena", Athena) # type: ignore |
| 67 | +aurora: Aurora = _DynamicInstantiate("aurora", Aurora) # type: ignore |
| 68 | +redshift: Redshift = _DynamicInstantiate("redshift", Redshift) # type: ignore |
| 69 | +dynamodb: DynamoDB = _DynamicInstantiate("dynamodb", DynamoDB) # type: ignore |
| 70 | +sagemaker: SageMaker = _DynamicInstantiate("sagemaker", SageMaker) # type: ignore |
| 71 | +cloudwatchlogs: CloudWatchLogs = _DynamicInstantiate("cloudwatchlogs", CloudWatchLogs) # type: ignore |
72 | 72 |
|
73 | 73 | getLogger("awswrangler").addHandler(NullHandler()) |
0 commit comments