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
Added unit and integ tests
Manual testing
Action Items
TODO in a separate PR:
Update CONTRIBUTING guide in the testing section to use descriptive method names following the test_<unit_under_test>_<state_or_input_under_test>_<expectation> naming convention
Description
This will allow retry and catch blocks to be added directly from the constructor.
Fixes #115
Why is the change necessary?
Currently,
retry
andcatch
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
andcatch
constructor arguments.Solution
In the constructor, when
retry
/catch
is notNone
, 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:
test_<unit_under_test>_<state_or_input_under_test>_<expectation>
naming conventionPull Request Checklist
Please check all boxes (including N/A items)
Testing
Documentation
Title and description
Fixes #xxx
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license.