Skip to content

Commit 10f3026

Browse files
committed
Docstring tweaks
1 parent 3c091e9 commit 10f3026

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

temporalio/client.py

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ async def start_workflow(
488488
static_details: General fixed details for this workflow execution that may appear in
489489
UI/CLI. This can be in Temporal markdown format and can span multiple lines. This is
490490
a fixed value on the workflow that cannot be updated. For details that can be
491-
updated, use `Workflow.CurrentDetails` within the workflow.
491+
updated, use :py:meth:`temporalio.workflow.get_current_details` within the workflow.
492492
start_delay: Amount of time to wait before starting the workflow.
493493
This does not work with ``cron_schedule``.
494494
start_signal: If present, this signal is sent as signal-with-start
@@ -1283,7 +1283,7 @@ async def create_schedule(
12831283
static_details: General fixed details for this workflow execution that may appear in
12841284
UI/CLI. This can be in Temporal markdown format and can span multiple lines. This is
12851285
a fixed value on the workflow that cannot be updated. For details that can be
1286-
updated, use `Workflow.CurrentDetails` within the workflow.
1286+
updated, use :py:meth:`temporalio.workflow.get_current_details` within the workflow.
12871287
rpc_metadata: Headers used on the RPC call. Keys here override
12881288
client-level RPC metadata keys.
12891289
rpc_timeout: Optional RPC deadline to set for the RPC call.
@@ -1517,9 +1517,8 @@ def id(self) -> str:
15171517

15181518
@property
15191519
def run_id(self) -> Optional[str]:
1520-
"""Run ID used for :py:meth:`signal`, :py:meth:`query`, and
1521-
:py:meth:`update` calls if present to ensure the signal/query/update
1522-
happen on this exact run.
1520+
"""If present, run ID used to ensure that requested operations apply
1521+
to this exact run.
15231522
15241523
This is only created via :py:meth:`Client.get_workflow_handle`.
15251524
:py:meth:`Client.start_workflow` will not set this value.
@@ -1546,8 +1545,7 @@ def result_run_id(self) -> Optional[str]:
15461545

15471546
@property
15481547
def first_execution_run_id(self) -> Optional[str]:
1549-
"""Run ID used for :py:meth:`cancel` and :py:meth:`terminate` calls if
1550-
present to ensure the cancel and terminate happen for a workflow ID
1548+
"""Run ID used to ensure requested operations apply to a workflow ID
15511549
started with this run ID.
15521550
15531551
This can be set when using :py:meth:`Client.get_workflow_handle`. When
@@ -2294,13 +2292,13 @@ async def start_update(
22942292
22952293
Args:
22962294
update: Update function or name on the workflow. arg: Single argument to the
2297-
update.
2295+
update.
22982296
wait_for_stage: Required stage to wait until returning: either ACCEPTED or
22992297
COMPLETED. ADMITTED is not currently supported. See
23002298
https://docs.temporal.io/workflows#update for more details.
2301-
args: Multiple arguments to the update. Cannot be set if arg is. id: ID of the
2302-
update. If not set, the default is a new UUID. result_type: For string
2303-
updates, this can set the specific result
2299+
args: Multiple arguments to the update. Cannot be set if arg is.
2300+
id: ID of the update. If not set, the default is a new UUID.
2301+
result_type: For string updates, this can set the specific result
23042302
type hint to deserialize into.
23052303
rpc_metadata: Headers used on the RPC call. Keys here override
23062304
client-level RPC metadata keys.
@@ -2418,7 +2416,6 @@ def get_update_handle_for(
24182416
id: Update ID to get a handle to.
24192417
workflow_run_id: Run ID to tie the handle to. If this is not set,
24202418
the :py:attr:`run_id` will be used.
2421-
result_type: The result type to deserialize into if known.
24222419
24232420
Returns:
24242421
The update handle.
@@ -2435,8 +2432,7 @@ class WithStartWorkflowOperation(Generic[SelfType, ReturnType]):
24352432
workflow if necessary.
24362433
24372434
.. warning::
2438-
This API is experimental
2439-
2435+
This API is experimental
24402436
"""
24412437

24422438
# Overload for no-param workflow, with_start
@@ -4857,7 +4853,7 @@ def __init__(
48574853
"""Create a workflow update handle.
48584854
48594855
Users should not create this directly, but rather use
4860-
:py:meth:`Client.start_workflow_update`.
4856+
:py:meth:`WorkflowHandle.start_update` or :py:meth:`WorkflowHandle.get_update_handle`.
48614857
"""
48624858
self._client = client
48634859
self._id = id
@@ -5578,15 +5574,16 @@ async def terminate_workflow(self, input: TerminateWorkflowInput) -> None:
55785574
async def start_workflow_update(
55795575
self, input: StartWorkflowUpdateInput
55805576
) -> WorkflowUpdateHandle[Any]:
5581-
"""Called for every :py:meth:`WorkflowHandle.update` and :py:meth:`WorkflowHandle.start_update` call."""
5577+
"""Called for every :py:meth:`WorkflowHandle.start_update` and :py:meth:`WorkflowHandle.execute_update` call."""
55825578
return await self.next.start_workflow_update(input)
55835579

55845580
async def start_update_with_start_workflow(
55855581
self, input: StartWorkflowUpdateWithStartInput
55865582
) -> WorkflowUpdateHandle[Any]:
5587-
"""Called for every :py:meth:`Client.start_update_with_start` and :py:meth:`Client.execute_update_with_start` call.
5583+
"""Called for every :py:meth:`Client.start_update_with_start_workflow` and :py:meth:`Client.execute_update_with_start_workflow` call.
5584+
55885585
.. warning::
5589-
This API is experimental
5586+
This API is experimental
55905587
"""
55915588
return await self.next.start_update_with_start_workflow(input)
55925589

temporalio/worker/_workflow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ class _DeadlockError(Exception):
442442
"""Exception class for deadlocks. Contains functionality to swap the default traceback for another."""
443443

444444
def __init__(self, message: str, replacement_tb: Optional[TracebackType] = None):
445-
"""Create a new DeadlockError, with message `msg` and optionally a traceback `tb` to be swapped in later.
445+
"""Create a new DeadlockError, with message `message` and optionally a traceback `replacement_tb` to be swapped in later.
446446
447447
Args:
448448
message: Message to be presented through exception.

temporalio/workflow.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ async def wait_condition(
11901190
fn: Non-async callback that accepts no parameters and returns a boolean.
11911191
timeout: Optional number of seconds to wait until throwing
11921192
:py:class:`asyncio.TimeoutError`.
1193-
timeout_summary: Optional simple string identifying the timer (created if `timeout` is
1193+
timeout_summary: Optional simple string identifying the timer (created if ``timeout`` is
11941194
present) that may be visible in UI/CLI. While it can be normal text, it is best to treat
11951195
as a timer ID.
11961196
"""
@@ -1313,7 +1313,7 @@ class LoggerAdapter(logging.LoggerAdapter):
13131313
13141314
Values added to ``extra`` are merged with the ``extra`` dictionary from a
13151315
logging call, with values from the logging call taking precedence. I.e. the
1316-
behavior is that of `merge_extra=True` in Python >= 3.13.
1316+
behavior is that of ``merge_extra=True`` in Python >= 3.13.
13171317
"""
13181318

13191319
def __init__(
@@ -3954,7 +3954,7 @@ async def start_child_workflow(
39543954
static_details: General fixed details for this child workflow execution that may appear in
39553955
UI/CLI. This can be in Temporal markdown format and can span multiple lines. This is
39563956
a fixed value on the workflow that cannot be updated. For details that can be
3957-
updated, use `Workflow.CurrentDetails` within the workflow.
3957+
updated, use :py:meth:`Workflow.get_current_details` within the workflow.
39583958
39593959
Returns:
39603960
A workflow handle to the started/existing workflow.

0 commit comments

Comments
 (0)