aws / aws-step-functions-data-science-sdk-python

Step Functions Data Science SDK for building machine learning (ML) workflows and pipelines on AWS
Apache License 2.0
285 stars 87 forks source link

fix: Retrier and Catcher passed to constructor for Task, Parallel and Map states are not added to the state's Retriers and Catchers #169

Closed ca-nguyen closed 2 years ago

ca-nguyen commented 2 years ago

Description

This will allow retry and catch blocks to be added directly from the constructor.

Fixes #115

Why is the change necessary?

Currently, retry and catch blocks passed to Task, Parallel and Map State constructors are not added to those state's Retriers and Catchers. With this change, it will possible do so.

Per the ASL documentation, Retry and Catch fields are arrays that contain Retriers and Catchers (see Task ASL doc for ex). This PR makes it possible to use lists or Retry/Catch objects in the constructor for retry and catch constructor arguments.

Solution

In the constructor, when retry/catch is not None, add it to the state's retries/catches. This change is done for the 3 States that support Retry and Catch blocks: Task, Parallel and Map.

Testing

Action Items

TODO in a separate PR:


Pull Request Checklist

Please check all boxes (including N/A items)

Testing

Documentation

Title and description


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.

StepFunctions-Bot commented 2 years ago

AWS CodeBuild CI Report

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository