Skip to content

Allow converter failures to fail workflow and other minor things #329

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jul 5, 2023

Conversation

cretz
Copy link
Member

@cretz cretz commented Jun 15, 2023

What was changed

  • Allow converter failures to fail workflow. We intentionally did not do codec at this time because it is more complicated.
  • Remove build info dump in CI
  • Remove Pydantic README reference
  • Update pydoctor
  • Add temporalio.exceptions.is_cancelled_exception helper function

Checklist

  1. Relates to [Feature Request] Temporal exceptions from converters and codecs should fail the workflow not task #321
  2. Closes Remove "similar to Pedantic" from no-generic part of README #328
  3. Closes Use stable pydoctor version instead of devel version #327
  4. Closes [Feature Request] Add helper for checking whether exception represents cancellation #326

@cretz cretz requested a review from a team as a code owner June 15, 2023 21:24
@cretz cretz changed the title Allow converter faiures to fail workflow and other minor things Allow converter failures to fail workflow and other minor things Jun 15, 2023
Copy link
Member

@Sushisource Sushisource left a comment

Choose a reason for hiding this comment

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

LGTM, just one question confirming the behavior

README.md Outdated
@@ -306,8 +306,8 @@ This notably doesn't include any `date`, `time`, or `datetime` objects as they m
Users are strongly encouraged to use a single `dataclass` for parameter and return types so fields with defaults can be
easily added without breaking compatibility.

Classes with generics may not have the generics properly resolved. The current implementation, similar to Pydantic, does
not have generic type resolution. Users should use concrete types.
Classes with generics may not have the generics properly resolved. The current implementation, does not have generic
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Classes with generics may not have the generics properly resolved. The current implementation, does not have generic
Classes with generics may not have the generics properly resolved. The current implementation does not have generic

True if a cancelled exception, false if not.
"""
return (
isinstance(exception, asyncio.CancelledError)
Copy link
Member

Choose a reason for hiding this comment

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

Oh boy this whole thing is not fun lol

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, we basically write this same thing in every SDK

Comment on lines +292 to +296
# We want failure errors during activation, like those that can
# happen during payload conversion, to fail the workflow not the
# task
try:
self._set_workflow_failure(err)
Copy link
Member

Choose a reason for hiding this comment

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

Making sure - this is only happening if they explicitly raise something like ApplicationError - not on any old random exception, correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, this catch clause is for temporalio.exceptions.FailureError only

@cretz cretz mentioned this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants