Skip to content

Commit 91a795e

Browse files
committed
Docstrings
1 parent 8420290 commit 91a795e

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

temporalio/nexus/_link_conversion.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
def workflow_handle_to_workflow_execution_started_event_link(
2727
handle: temporalio.client.WorkflowHandle[Any, Any],
2828
) -> temporalio.api.common.v1.Link.WorkflowEvent:
29+
"""Create a WorkflowEvent link corresponding to a started workflow"""
2930
if handle.first_execution_run_id is None:
3031
raise ValueError(
3132
f"Workflow handle {handle} has no first execution run ID. "
@@ -39,13 +40,18 @@ def workflow_handle_to_workflow_execution_started_event_link(
3940
event_id=1,
4041
event_type=temporalio.api.enums.v1.EventType.EVENT_TYPE_WORKFLOW_EXECUTION_STARTED,
4142
),
42-
# TODO(nexus-preview): RequestIdReference?
43+
# TODO(nexus-preview): RequestIdReference
4344
)
4445

4546

4647
def workflow_event_to_nexus_link(
4748
workflow_event: temporalio.api.common.v1.Link.WorkflowEvent,
4849
) -> nexusrpc.Link:
50+
"""Convert a WorkflowEvent link into a nexusrpc link
51+
52+
Used when propagating links from a StartWorkflow response to a Nexus start operation
53+
response.
54+
"""
4955
scheme = "temporal"
5056
namespace = urllib.parse.quote(workflow_event.namespace)
5157
workflow_id = urllib.parse.quote(workflow_event.workflow_id)
@@ -61,6 +67,11 @@ def workflow_event_to_nexus_link(
6167
def nexus_link_to_workflow_event(
6268
link: nexusrpc.Link,
6369
) -> Optional[temporalio.api.common.v1.Link.WorkflowEvent]:
70+
"""Convert a nexus link into a WorkflowEvent link
71+
72+
This is used when propagating links from a Nexus start operation request to a
73+
StartWorklow request.
74+
"""
6475
url = urllib.parse.urlparse(link.url)
6576
match = _LINK_URL_PATH_REGEX.match(url.path)
6677
if not match:

0 commit comments

Comments
 (0)