Skip to content

Commit 49c584c

Browse files
committed
fix: restore SKLearnProcessor positional args
Draft change modified sequence of 'instance_type' positional arg, which is potentially breaking and unnecessary. Also align comments and explicit kwarg usage better with previous work.
1 parent 74f5436 commit 49c584c

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

src/sagemaker/sklearn/processing.py

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,9 @@
2222

2323

2424
class SKLearnProcessor(FrameworkProcessor):
25-
"""Initialize an ``SKLearnProcessor`` instance.
25+
"""Handles Amazon SageMaker processing tasks for jobs using scikit-learn.
2626
27-
The SKLearnProcessor handles Amazon SageMaker processing tasks for jobs using scikit-learn.
28-
29-
Unless ``image_uri`` is specified, the scikit-learn environment is an
30-
Amazon-built Docker container that executes functions defined in the supplied
31-
``code`` Python script.
32-
33-
The arguments have the exact same meaning as in ``FrameworkProcessor``.
34-
35-
.. tip::
36-
37-
You can find additional parameters for initializing this class at
38-
:class:`~sagemaker.processing.FrameworkProcessor`.
27+
This processor executes a Python script in a scikit-learn execution environment.
3928
"""
4029

4130
estimator_cls = SKLearn
@@ -44,8 +33,8 @@ def __init__(
4433
self,
4534
framework_version,
4635
role,
47-
instance_count,
4836
instance_type,
37+
instance_count,
4938
py_version="py3",
5039
image_uri=None,
5140
command=None,
@@ -60,24 +49,36 @@ def __init__(
6049
tags=None,
6150
network_config=None,
6251
):
63-
"""This processor executes a Python script in a scikit-learn execution environment."""
64-
super().__init__(
65-
self.estimator_cls,
66-
framework_version,
67-
role,
68-
instance_count,
69-
instance_type,
70-
py_version,
71-
image_uri,
72-
command,
73-
volume_size_in_gb,
74-
volume_kms_key,
75-
output_kms_key,
76-
code_location,
77-
max_runtime_in_seconds,
78-
base_job_name,
79-
sagemaker_session,
80-
env,
81-
tags,
82-
network_config,
52+
"""Initialize an ``SKLearnProcessor`` instance.
53+
54+
Unless ``image_uri`` is specified, the SKLearn environment is an
55+
Amazon-built Docker container that executes functions defined in the supplied
56+
``code`` Python script.
57+
58+
The arguments have the exact same meaning as in ``FrameworkProcessor``.
59+
60+
.. tip::
61+
62+
You can find additional parameters for initializing this class at
63+
:class:`~sagemaker.processing.FrameworkProcessor`.
64+
"""
65+
super(SKLearnProcessor).__init__(
66+
estimator_cls=self.estimator_cls,
67+
framework_version=framework_version,
68+
role=role,
69+
image_uri=image_uri,
70+
instance_count=instance_count,
71+
instance_type=instance_type,
72+
py_version=py_version,
73+
command=command,
74+
volume_size_in_gb=volume_size_in_gb,
75+
volume_kms_key=volume_kms_key,
76+
output_kms_key=output_kms_key,
77+
code_location=code_location,
78+
max_runtime_in_seconds=max_runtime_in_seconds,
79+
base_job_name=base_job_name,
80+
sagemaker_session=sagemaker_session,
81+
env=env,
82+
tags=tags,
83+
network_config=network_config,
8384
)

0 commit comments

Comments
 (0)