Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@ca-nguyen
Copy link
Contributor

@ca-nguyenca-nguyen commentedSep 23, 2021
edited
Loading

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 (seeTask ASL doc for ex). This PR makes it possible to use lists or Retry/Catch objects in the constructor forretry andcatch constructor arguments.

Solution

In the constructor, whenretry/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 andMap.

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 thetest_<unit_under_test>_<state_or_input_under_test>_<expectation> naming convention

Pull Request Checklist

Please check all boxes (including N/A items)

Testing

  • Unit tests added
  • integration test added

Documentation

  • docs: All relevantdocs updated
  • docstrings: All public APIs documented

Title and description

  • Change type: Title is prefixed with change type: and followsconventional commits
  • References: Indicate issues fixed via:Fixes #xxx

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

Copy link
Contributor

@shivlaksshivlaks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

great job!

couple of small general things

  • this is a fix... the discarding of user provided parameters in constructor is a bug that we are addressing rather than a feature.
  • let's tighten up the description to also include that this is for theTask,Parallel, andMap states. This is covered in the subsequent section but I think it belongs in the title
  • "Manual Testing" - this should detail what manual testing we performed. Another contributor should be able to read your description and perform the same manual test. It's both a teaching tool as well as a valuable artifact for posterity.

@ca-nguyenca-nguyen changed the titlefeat: Add retry and catch to Retriers and Catchers when passed to constructorfix: Retrier and Catcher passed to constructor for Task, Parallel and Map states are not added to the state's Retriers and CatchersOct 7, 2021
wong-a
wong-a previously approved these changesOct 7, 2021
Copy link
Contributor

@wong-awong-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM besides Shiv's comment on the integ test.

(CATCH,EXPECTED_CATCH),
(CATCHES,EXPECTED_CATCHES)
])
deftest_parallel_state_constructor_with_catch_adds_catcher_to_catchers(catch,expected_catch):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

comment (non-blocking): This reads a lot better than before. I still don't think each test case needs to be parameterized at all, but that's nit picking/preference at this point.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

agreed. im of the same opinion - it's a lot easier to understand what a test is doing.
verbosity in tests like these does more good than harm

Copy link
Contributor

@wong-awong-a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

:shipit:

@StepFunctions-Bot
Copy link
Contributor

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildProject6AEA49D1-sEHrOdk7acJc
  • Commit ID:cd1fc9e
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered bygithub-codebuild-logs, available on theAWS Serverless Application Repository

(CATCH,EXPECTED_CATCH),
(CATCHES,EXPECTED_CATCHES)
])
deftest_parallel_state_constructor_with_catch_adds_catcher_to_catchers(catch,expected_catch):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

agreed. im of the same opinion - it's a lot easier to understand what a test is doing.
verbosity in tests like these does more good than harm

task_resource=f"arn:{get_aws_partition()}:states:::sagemaker:createTrainingJob.sync"

#change the parameters to causetask state to fail
#Provide invalid TrainingImage to causeStates.TaskFailed error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

thank you, it's a lot less mysterious what we're trying to do now

@ca-nguyenca-nguyen merged commit7f223e8 intoaws:mainOct 7, 2021
@ca-nguyenca-nguyen deleted the fix-retry-in-task-constructor branchOctober 27, 2021 01:12
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

2 more reviewers

@shivlaksshivlaksshivlaks approved these changes

@wong-awong-awong-a approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Can't serialize graphs using Retry

4 participants

@ca-nguyen@StepFunctions-Bot@shivlaks@wong-a

[8]ページ先頭

©2009-2025 Movatter.jp