Skip to content

Commit 3228a2e

Browse files
author
Payton Staub
committed
Correct type annotation for training step inputs
1 parent c2fbe75 commit 3228a2e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

src/sagemaker/workflow/steps.py

+18-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import abc
1717

1818
from enum import Enum
19-
from typing import Dict, List
19+
from typing import Dict, List, Union
2020

2121
import attr
2222

@@ -145,7 +145,7 @@ def __init__(
145145
self,
146146
name: str,
147147
estimator: EstimatorBase,
148-
inputs: TrainingInput = None,
148+
inputs: Union[TrainingInput, dict, str] = None,
149149
cache_config: CacheConfig = None,
150150
depends_on: List[str] = None,
151151
):
@@ -157,7 +157,22 @@ def __init__(
157157
Args:
158158
name (str): The name of the training step.
159159
estimator (EstimatorBase): A `sagemaker.estimator.EstimatorBase` instance.
160-
inputs (TrainingInput): A `sagemaker.inputs.TrainingInput` instance. Defaults to `None`.
160+
inputs (str or dict or sagemaker.inputs.TrainingInput): Information
161+
about the training data. This can be one of three types:
162+
163+
* (str) the S3 location where training data is saved, or a file:// path in
164+
local mode.
165+
* (dict[str, str] or dict[str, sagemaker.inputs.TrainingInput]) If using multiple
166+
channels for training data, you can specify a dict mapping channel names to
167+
strings or :func:`~sagemaker.inputs.TrainingInput` objects.
168+
* (sagemaker.inputs.TrainingInput) - channel configuration for S3 data sources
169+
that can provide additional information as well as the path to the training
170+
dataset.
171+
See :func:`sagemaker.inputs.TrainingInput` for full details.
172+
* (sagemaker.session.FileSystemInput) - channel configuration for
173+
a file system data source that can provide additional information as well as
174+
the path to the training dataset.
175+
161176
cache_config (CacheConfig): A `sagemaker.workflow.steps.CacheConfig` instance.
162177
depends_on (List[str]): A list of step names this `sagemaker.workflow.steps.TrainingStep`
163178
depends on

0 commit comments

Comments
 (0)