Skip to content
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

docs: added notes to ApplicationError and FailureError exception docstrings. #718

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

GSmithApps
Copy link

What was changed

Added notes to exception docstrings.

Why?

Increase clarity and dicsoverability.

@CLAassistant
Copy link

CLAassistant commented Jan 2, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@GSmithApps GSmithApps force-pushed the docs-added-notes-to-exception-docstrings branch from 2c6c45b to 41d13a7 Compare January 2, 2025 22:52
Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

@dandavison - any thoughts/suggestions on API docs for explaining exceptions vs README or docs.temporal.io?

Comment on lines 50 to 51
Any exception that does not extend this exception
is considered a Workflow Task Failure. These types of failures will cause the Workflow Task to be retried.
Copy link
Member

@cretz cretz Jan 6, 2025

Choose a reason for hiding this comment

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

It's actually more complicated than this since it is now configurable. We dedicate a section of our README to this at https://github.com/temporalio/sdk-python?tab=readme-ov-file#exceptions. Ideally we don't have to duplicate so much in here and there considering they may not say the same things, as is the case already here where it is not explained that this is customizable.

@dandavison
Copy link
Contributor

I like the direction of this PR, but would like to work on the wording a bit before merging.

@dandavison - any thoughts/suggestions on API docs for explaining exceptions vs README or docs.temporal.io?

IMO the information added in this PR is basic and important enough that it should be in the code (API docs) as this PR does. Ideally it should also be accurately duplicated in the docs site. I think the fact that this is customizable should definitely be noted, but should not distract us from communicating the basic Temporal exception philosophy that failing the workflow execution requires special exceptions to be raised and that, by default, unhandled exceptions fail the task.

temporalio/exceptions.py Outdated Show resolved Hide resolved
temporalio/exceptions.py Outdated Show resolved Hide resolved
@GSmithApps
Copy link
Author

GSmithApps commented Jan 6, 2025

This is awesome - thank you guys so much for looking at this.

Dan, I committed your suggestions 👍

One other thing I think we should include is a note about manually failing an Activity. For example, if a developer/user wants to fail an Activity Task Execution (or I guess the execution as a whole), shouldn't they use an Application Error? In our notes here, we only mention things about failing Workflow Executions.

Lastly, I think we'll have similar changes in the other SDKs, for example Go 👍

@GSmithApps
Copy link
Author

Please forgive me if I'm missing something obvious, but do either of you know why the pipeline is failing? I'm pretty sure I'm making the linter happy, and this is failing after 13 minutes and 10,000 lines of logs. Also, I tried rerunning it, and I'm getting the same error.

@dandavison
Copy link
Contributor

do either of you know why the pipeline is failing?

This isn't your fault! The test suite has some flakes which we need to address. Unfortunately for now we just have to re-run until they pass. (Not sure yet what happened with the features tests)

@GSmithApps
Copy link
Author

Hi @dandavison , thanks for the note on the pipeline, and thanks for the notes in general!

I've tried five times, and I can't seem to get this last piece to pass. Maybe we can try tomorrow or something -- I'm not sure if you have any tricks up your sleeve.

In any case, I'm happy with this however it turns out, so please feel free to make any modifications or merge however you please. I'll stay out of your hair and let you and the experts take it from here if that works 👍🏼 Certainly please do reach out though if there's any remaining legwork -- I'd be happy to take care of it.

@GSmithApps GSmithApps marked this pull request as ready for review January 7, 2025 21:50
@GSmithApps GSmithApps requested a review from a team as a code owner January 7, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants