

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

# 제한 사항
<a name="pipelines-step-decorator-limit"></a>

아래 섹션에서는 파이프라인 단계에 `@step` 데코레이터를 사용할 때 알아야 할 제한 사항을 간략하게 설명합니다.

## 함수 인수 제한 사항
<a name="pipelines-step-decorator-arg"></a>

입력 인수를 `@step`으로 데코레이션된 함수에 전달하면 다음 제한 사항이 적용됩니다.
+ `DelayedReturn`, `Properties`(다른 유형의 단계 중), `Parameter` 및 `ExecutionVariable` 객체를 `@step`으로 데코레이션된 함수에 인수로 전달할 수 있습니다. 하지만 `@step`으로 데코레이션된 함수는 `JsonGet` 및 `Join` 객체를 인수로 지원하지 않습니다.
+ `@step` 함수에서 파이프라인 변수에 직접 액세스할 수 없습니다. 다음 예시는 오류를 유발합니다.

  ```
  param = ParameterInteger(name="<parameter-name>", default_value=10)
  
  @step
  def func():
      print(param)
  
  func() # this raises a SerializationError
  ```
+ 파이프라인 변수를 다른 객체에 중첩하여 `@step` 함수에 전달할 수 없습니다. 다음 예시는 오류를 유발합니다.

  ```
  param = ParameterInteger(name="<parameter-name>", default_value=10)
  
  @step
  def func(arg):
      print(arg)
  
  func(arg=(param,)) # this raises a SerializationError because param is nested in a tuple
  ```
+ 함수의 입력 및 출력은 직렬화되므로 함수의 입력 또는 출력으로 전달할 수 있는 데이터 유형에 제한이 있습니다. 자세한 내용은 [원격 함수 간접 호출](train-remote-decorator-invocation.md)의 *Data serialization and deserialization* 섹션을 참조하세요. `@step`으로 데코레이션된 함수에도 동일한 제한이 적용됩니다.
+ Boto 클라이언트가 있는 객체는 직렬화할 수 없으므로 `@step`으로 데코레이션된 함수에 입력 또는 출력으로 그러한 객체를 전달할 수 없습니다. 예를 들어 `Estimator`, `Predictor`, `Processor`와 같은 SageMaker Python SDK 클라이언트 클래스는 직렬화할 수 없습니다.

## 함수 가져오기
<a name="pipelines-step-decorator-best-import"></a>

함수 외부가 아닌 내부 단계에서 필요한 라이브러리를 가져와야 합니다. 전역 범위에서 가져오는 경우 함수를 직렬화하는 동안 가져오기 충돌이 발생할 위험이 있습니다. 예를 들어 `sklearn.pipeline.Pipeline`은 `sagemaker.workflow.pipeline.Pipeline`으로 재정의될 수 있습니다.

## 함수 반환 값의 하위 멤버 참조
<a name="pipelines-step-decorator-best-child"></a>

`@step`으로 데코레이션된 함수의 반환 값의 하위 멤버를 참조하는 경우 다음 제한 사항이 적용됩니다.
+ 다음 예시와 같이 `DelayedReturn` 객체가 튜플, 목록 또는 딕셔너리를 나타내는 경우 `[]`로 하위 멤버를 참조할 수 있습니다.

  ```
  delayed_return[0]
  delayed_return["a_key"]
  delayed_return[1]["a_key"]
  ```
+ 함수를 간접 호출할 때 기본 튜플 또는 목록의 정확한 길이를 알 수 없으므로 튜플 또는 목록 출력을 압축 해제할 수 없습니다. 다음 예시는 오류를 유발합니다.

  ```
  a, b, c = func() # this raises ValueError
  ```
+ `DelayedReturn` 객체에 대해 반복할 수 없습니다. 다음 예시는 오류를 유발합니다.

  ```
  for item in func(): # this raises a NotImplementedError
  ```
+ '`.`'로 임의의 하위 멤버를 참조할 수 없습니다. 다음 예시는 오류를 유발합니다.

  ```
  delayed_return.a_child # raises AttributeError
  ```

## 지원되지 않는 기존 파이프라인 기능
<a name="pipelines-step-decorator-best-unsupported"></a>

다음 파이프라인 기능과 함께 `@step` 데코레이터를 사용할 수 없습니다.
+ [파이프라인 단계 캐싱](https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-caching.html)
+ [속성 파일](https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-propertyfile.html#build-and-manage-propertyfile-property)