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

Edit @workflow.init docstring #662

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions temporalio/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,19 +150,11 @@ def init(

This may be used on the __init__ method of the workflow class to specify
that it accepts the same workflow input arguments as the ``@workflow.run``
method. It may not be used on any other method.

If used, the workflow will be instantiated as
``MyWorkflow(**workflow_input_args)``. If not used, the workflow will be
instantiated as ``MyWorkflow()``.

Note that the ``@workflow.run`` method is always called as
``my_workflow.my_run_method(**workflow_input_args)``. If you use the
``@workflow.init`` decorator, the parameter list of your __init__ and
``@workflow.run`` methods must be identical.
method. If used, the parameters of your __init__ and ``@workflow.run``
methods must be identical.

Args:
init_fn: The __init__function to decorate.
init_fn: The __init__ method to decorate.
"""
if init_fn.__name__ != "__init__":
raise ValueError("@workflow.init may only be used on the __init__ method")
Expand Down
Loading