-
Notifications
You must be signed in to change notification settings - Fork 58
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
3 more Python samples #65
Conversation
parser.add_argument("--start-workflow", help="Start workflow with this ID") | ||
parser.add_argument("--query-workflow", help="Query workflow with this ID") |
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.
nit: I'd make these subcommands:
https://docs.python.org/3/library/argparse.html#sub-commands
I'd also encourage using a nicer argument parser like click for samples where we don't care too much about the additional dependency.
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.
I would rather not add a dependency and I intentionally didn't use subcommands just in case someone wanted to run both themselves
@@ -0,0 +1,97 @@ | |||
# Patching Sample | |||
|
|||
This sample shows how to safely alter a workflow using `patched` and `deprecate_patch` in stages. |
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.
Why did you choose this workflow as the sample for patches?
It's not especially practical and doesn't show how patches help making workflow changes that would otherwise break determinism, changing a query result can be done without patching.
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.
I didn't really choose any particular one, I just wanted to focus on the patch part without creating activities or timers. I am afraid, as has happened with other samples, that people focus on the wrong part if I add extra things. In this case, you're trying to focus on what is being patched instead of the patch itself, which I guarantee means if I do then the user will as well which is what I'm trying to avoid.
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.
I have updated the sample to use activities instead. I was gonna demonstrate the non-determinism in README, but I can't until I upgrade Python to a core version with temporalio/sdk-core#475.
What was changed