-
Notifications
You must be signed in to change notification settings - Fork 111
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
# 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
What was changed
temporalio.exceptions.is_cancelled_exception
helper functionChecklist