Skip to content

Commit 85dba76

Browse files
committed
converting DynamicInstantiate to private
1 parent 73105dd commit 85dba76

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

awswrangler/__init__.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from awswrangler.session import Session # noqa
2222

2323

24-
class DynamicInstantiate:
24+
class _DynamicInstantiate:
2525
"""
2626
Class to instantiate the default Session.
2727
@@ -50,24 +50,24 @@ def __init__(self, module_name, class_ref):
5050

5151
def __getattr__(self, name):
5252
"""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)
5656

5757

5858
if version_info < (3, 8) and importlib.util.find_spec("pyspark"): # type: ignore
5959
from awswrangler.spark import Spark # noqa
60-
spark: Spark = DynamicInstantiate("spark", Spark) # type: ignore
60+
spark: Spark = _DynamicInstantiate("spark", Spark) # type: ignore
6161

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
7272

7373
getLogger("awswrangler").addHandler(NullHandler())

building/build-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
set -ex
33

44
cd ..
5-
sphinx-apidoc --separate -f --no-toc -H "API Reference" -o docs/source/api awswrangler/
5+
sphinx-apidoc --maxdepth 10 --separate --force --no-toc -H "API Reference" -o docs/source/api awswrangler/
66
make -C docs/ html
77
doc8 --ignore D001 docs/source
88
cd building

0 commit comments

Comments
 (0)