Skip to content

Commit c859e3b

Browse files
edwardpsEdward Sun
authored andcommitted
change: make collect_parameters decorator as private (#1289)
Co-authored-by: Edward Sun <[email protected]>
1 parent 78718f2 commit c859e3b

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

src/sagemaker/workflow/notebook_job_step.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
RequestType,
4141
PipelineVariable,
4242
)
43-
from sagemaker.workflow.utilities import collect_parameters, load_step_compilation_context
43+
from sagemaker.workflow.utilities import _collect_parameters, load_step_compilation_context
4444
from sagemaker.session import get_execution_role
4545

4646
from sagemaker.s3_utils import s3_path_join
@@ -67,7 +67,7 @@ class NotebookJobStep(ConfigurableRetryStep):
6767
<https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-auto-run.html>`_.
6868
"""
6969

70-
@collect_parameters
70+
@_collect_parameters
7171
def __init__(
7272
self,
7373
# Following parameters will set by @collect_parameters

src/sagemaker/workflow/utilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def trim_request_dict(request_dict, job_key, config):
463463
return request_dict
464464

465465

466-
def collect_parameters(func):
466+
def _collect_parameters(func):
467467
"""The decorator function is to collect all the params passed into an invoked function of class.
468468
469469
These parameters are set as properties of the class instance. The use case is to simplify

tests/unit/sagemaker/workflow/test_utilities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
hash_file,
2222
hash_files_or_dirs,
2323
trim_request_dict,
24-
collect_parameters,
24+
_collect_parameters,
2525
)
2626
from pathlib import Path
2727
import unittest
@@ -149,12 +149,12 @@ def __init__(self, param1):
149149
self.param1 = param1
150150

151151
class SampleClass(BaseClass):
152-
@collect_parameters
152+
@_collect_parameters
153153
def __init__(self, param1, param2, param3="default_value"):
154154
super(SampleClass, self).__init__(param1)
155155
pass
156156

157-
@collect_parameters
157+
@_collect_parameters
158158
def abc(self, param2, param4="default_value", param5=None):
159159
pass
160160

0 commit comments

Comments
 (0)