Skip to content

Commit af9f80a

Browse files
committed
Add experimental notices
1 parent ea402d9 commit af9f80a

File tree

2 files changed

+143
-19
lines changed

2 files changed

+143
-19
lines changed

temporalio/client.py

Lines changed: 131 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,6 +1317,9 @@ async def start_activity(
13171317
) -> ActivityHandle[ReturnType]:
13181318
"""Start an activity and return its handle.
13191319
1320+
.. warning::
1321+
This API is experimental.
1322+
13201323
Args:
13211324
activity: String name or callable activity function to execute.
13221325
args: Arguments to pass to the activity.
@@ -1401,6 +1404,9 @@ async def execute_activity(
14011404
) -> ReturnType:
14021405
"""Start an activity, wait for it to complete, and return its result.
14031406
1407+
.. warning::
1408+
This API is experimental.
1409+
14041410
This is a convenience method that combines :py:meth:`start_activity` and
14051411
:py:meth:`ActivityHandle.result`.
14061412
@@ -1444,6 +1450,9 @@ def list_activities(
14441450
) -> ActivityExecutionAsyncIterator:
14451451
"""List activities.
14461452
1453+
.. warning::
1454+
This API is experimental.
1455+
14471456
This does not make a request until the first iteration is attempted.
14481457
Therefore any errors will not occur until then.
14491458
@@ -1484,6 +1493,9 @@ async def count_activities(
14841493
) -> ActivityExecutionCount:
14851494
"""Count activities matching the query.
14861495
1496+
.. warning::
1497+
This API is experimental.
1498+
14871499
Args:
14881500
query: A Temporal visibility filter for activities.
14891501
rpc_metadata: Headers used on the RPC call. Keys here override
@@ -1507,6 +1519,9 @@ def get_activity_handle(
15071519
) -> ActivityHandle[Any]:
15081520
"""Get a handle to an existing activity, as the caller of that activity.
15091521
1522+
.. warning::
1523+
This API is experimental.
1524+
15101525
To get a handle to an activity execution that you control for manual completion and
15111526
heartbeating, see :py:meth:`Client.get_async_activity_handle`.
15121527
@@ -3117,7 +3132,11 @@ async def __anext__(self) -> Union[ActivityExecution, WorkflowActivityExecution]
31173132
# https://github.com/temporalio/api/pull/640/files
31183133
@dataclass(frozen=True)
31193134
class ActivityExecution:
3120-
"""Info for a standalone activity execution from list response."""
3135+
"""Info for a standalone activity execution from list response.
3136+
3137+
.. warning::
3138+
This API is experimental.
3139+
"""
31213140

31223141
activity_id: str
31233142
"""Activity ID."""
@@ -3197,7 +3216,11 @@ def _from_raw_info(
31973216

31983217
@dataclass(frozen=True)
31993218
class WorkflowActivityExecution:
3200-
"""Info for a workflow activity execution from list response."""
3219+
"""Info for a workflow activity execution from list response.
3220+
3221+
.. warning::
3222+
This API is experimental.
3223+
"""
32013224

32023225
activity_id: str
32033226
"""Activity ID."""
@@ -3264,7 +3287,11 @@ def _from_raw_info(
32643287

32653288
@dataclass(frozen=True)
32663289
class ActivityExecutionCount:
3267-
"""Representation of a count from a count activities call."""
3290+
"""Representation of a count from a count activities call.
3291+
3292+
.. warning::
3293+
This API is experimental.
3294+
"""
32683295

32693296
count: int
32703297
"""Total count matching the filter, if any."""
@@ -3281,7 +3308,11 @@ def _from_raw(
32813308

32823309
@dataclass(frozen=True)
32833310
class ActivityExecutionDescription:
3284-
"""Detailed information about an activity execution from describe response."""
3311+
"""Detailed information about an activity execution from describe response.
3312+
3313+
.. warning::
3314+
This API is experimental.
3315+
"""
32853316

32863317
activity_id: str
32873318
"""Activity ID."""
@@ -3455,7 +3486,11 @@ async def _from_raw_info(
34553486

34563487
@dataclass(frozen=True)
34573488
class ActivityIDReference:
3458-
"""Information identifying an activity execution."""
3489+
"""Information identifying an activity execution.
3490+
3491+
.. warning::
3492+
This API is experimental.
3493+
"""
34593494

34603495
workflow_id: Optional[str]
34613496
run_id: Optional[str]
@@ -3609,7 +3644,11 @@ def with_context(self, context: SerializationContext) -> Self:
36093644
# be generic in the activity type in addition to the return type (as WorkflowHandle), to support
36103645
# static type inference for signal/query/update.
36113646
class ActivityHandle(Generic[ReturnType]):
3612-
"""Handle representing a standalone activity execution."""
3647+
"""Handle representing a standalone activity execution.
3648+
3649+
.. warning::
3650+
This API is experimental.
3651+
"""
36133652

36143653
def __init__(
36153654
self,
@@ -3676,6 +3715,9 @@ async def result(
36763715
) -> ReturnType:
36773716
"""Wait for result of the activity.
36783717
3718+
.. warning::
3719+
This API is experimental.
3720+
36793721
The result may already be known if this method has been called before,
36803722
in which case no network call is made. Otherwise the result will be
36813723
polled for until it is available.
@@ -3769,6 +3811,9 @@ async def cancel(
37693811
) -> None:
37703812
"""Request cancellation of the activity.
37713813
3814+
.. warning::
3815+
This API is experimental.
3816+
37723817
Requesting cancellation of an activity does not automatically transition the activity to
37733818
canceled status. If the activity is heartbeating, a :py:class:`exceptions.CancelledError`
37743819
exception will be raised when receiving the heartbeat response; if the activity allows this
@@ -3799,6 +3844,9 @@ async def terminate(
37993844
) -> None:
38003845
"""Terminate the activity execution immediately.
38013846
3847+
.. warning::
3848+
This API is experimental.
3849+
38023850
Termination does not reach the worker and the activity code cannot react to it.
38033851
A terminated activity may have a running attempt and will be requested to be
38043852
canceled by the server when it heartbeats.
@@ -3826,6 +3874,9 @@ async def describe(
38263874
) -> ActivityExecutionDescription:
38273875
"""Describe the activity execution.
38283876
3877+
.. warning::
3878+
This API is experimental.
3879+
38293880
Args:
38303881
rpc_metadata: Headers used on the RPC call.
38313882
rpc_timeout: Optional RPC deadline to set for the RPC call.
@@ -3854,6 +3905,9 @@ async def pause(
38543905
) -> None:
38553906
"""Pause the activity.
38563907
3908+
.. warning::
3909+
This API is experimental.
3910+
38573911
Args:
38583912
reason: Reason for pausing the activity.
38593913
rpc_metadata: Headers used on the RPC call. Keys here override
@@ -3893,6 +3947,9 @@ async def unpause(
38933947
) -> None:
38943948
"""Unpause the activity.
38953949
3950+
.. warning::
3951+
This API is experimental.
3952+
38963953
Args:
38973954
reset_attempts: Whether to reset the number of attempts.
38983955
rpc_metadata: Headers used on the RPC call. Keys here override
@@ -3933,6 +3990,9 @@ async def reset(
39333990
) -> None:
39343991
"""Reset the activity.
39353992
3993+
.. warning::
3994+
This API is experimental.
3995+
39363996
Args:
39373997
reset_heartbeat: Whether to reset heartbeat details.
39383998
keep_paused: If activity is paused, whether to keep it paused after reset.
@@ -6394,7 +6454,11 @@ def __init__(self) -> None:
63946454

63956455

63966456
class ActivityFailedError(temporalio.exceptions.TemporalError):
6397-
"""Error that occurs when a standalone activity is unsuccessful."""
6457+
"""Error that occurs when a standalone activity is unsuccessful.
6458+
6459+
.. warning::
6460+
This API is experimental.
6461+
"""
63986462

63996463
def __init__(self, *, cause: BaseException) -> None:
64006464
"""Create activity failure error."""
@@ -6566,7 +6630,11 @@ class TerminateWorkflowInput:
65666630

65676631
@dataclass
65686632
class StartActivityInput:
6569-
"""Input for :py:meth:`OutboundInterceptor.start_activity`."""
6633+
"""Input for :py:meth:`OutboundInterceptor.start_activity`.
6634+
6635+
.. warning::
6636+
This API is experimental.
6637+
"""
65706638

65716639
activity_type: str
65726640
args: Sequence[Any]
@@ -6596,7 +6664,11 @@ class StartActivityInput:
65966664

65976665
@dataclass
65986666
class CancelActivityInput:
6599-
"""Input for :py:meth:`OutboundInterceptor.cancel_activity`."""
6667+
"""Input for :py:meth:`OutboundInterceptor.cancel_activity`.
6668+
6669+
.. warning::
6670+
This API is experimental.
6671+
"""
66006672

66016673
activity_id: str
66026674
run_id: str
@@ -6607,7 +6679,11 @@ class CancelActivityInput:
66076679

66086680
@dataclass
66096681
class TerminateActivityInput:
6610-
"""Input for :py:meth:`OutboundInterceptor.terminate_activity`."""
6682+
"""Input for :py:meth:`OutboundInterceptor.terminate_activity`.
6683+
6684+
.. warning::
6685+
This API is experimental.
6686+
"""
66116687

66126688
activity_id: str
66136689
run_id: str
@@ -6618,7 +6694,11 @@ class TerminateActivityInput:
66186694

66196695
@dataclass
66206696
class DescribeActivityInput:
6621-
"""Input for :py:meth:`OutboundInterceptor.describe_activity`."""
6697+
"""Input for :py:meth:`OutboundInterceptor.describe_activity`.
6698+
6699+
.. warning::
6700+
This API is experimental.
6701+
"""
66226702

66236703
activity_id: str
66246704
run_id: str
@@ -6628,7 +6708,11 @@ class DescribeActivityInput:
66286708

66296709
@dataclass
66306710
class ListActivitiesInput:
6631-
"""Input for :py:meth:`OutboundInterceptor.list_activities`."""
6711+
"""Input for :py:meth:`OutboundInterceptor.list_activities`.
6712+
6713+
.. warning::
6714+
This API is experimental.
6715+
"""
66326716

66336717
query: Optional[str]
66346718
page_size: int
@@ -6640,7 +6724,11 @@ class ListActivitiesInput:
66406724

66416725
@dataclass
66426726
class CountActivitiesInput:
6643-
"""Input for :py:meth:`OutboundInterceptor.count_activities`."""
6727+
"""Input for :py:meth:`OutboundInterceptor.count_activities`.
6728+
6729+
.. warning::
6730+
This API is experimental.
6731+
"""
66446732

66456733
query: Optional[str]
66466734
rpc_metadata: Mapping[str, Union[str, bytes]]
@@ -6988,33 +7076,57 @@ async def terminate_workflow(self, input: TerminateWorkflowInput) -> None:
69887076
### Activity calls
69897077

69907078
async def start_activity(self, input: StartActivityInput) -> ActivityHandle[Any]:
6991-
"""Called for every :py:meth:`Client.start_activity` call."""
7079+
"""Called for every :py:meth:`Client.start_activity` call.
7080+
7081+
.. warning::
7082+
This API is experimental.
7083+
"""
69927084
return await self.next.start_activity(input)
69937085

69947086
async def cancel_activity(self, input: CancelActivityInput) -> None:
6995-
"""Called for every :py:meth:`ActivityHandle.cancel` call."""
7087+
"""Called for every :py:meth:`ActivityHandle.cancel` call.
7088+
7089+
.. warning::
7090+
This API is experimental.
7091+
"""
69967092
await self.next.cancel_activity(input)
69977093

69987094
async def terminate_activity(self, input: TerminateActivityInput) -> None:
6999-
"""Called for every :py:meth:`ActivityHandle.terminate` call."""
7095+
"""Called for every :py:meth:`ActivityHandle.terminate` call.
7096+
7097+
.. warning::
7098+
This API is experimental.
7099+
"""
70007100
await self.next.terminate_activity(input)
70017101

70027102
async def describe_activity(
70037103
self, input: DescribeActivityInput
70047104
) -> ActivityExecutionDescription:
7005-
"""Called for every :py:meth:`ActivityHandle.describe` call."""
7105+
"""Called for every :py:meth:`ActivityHandle.describe` call.
7106+
7107+
.. warning::
7108+
This API is experimental.
7109+
"""
70067110
return await self.next.describe_activity(input)
70077111

70087112
def list_activities(
70097113
self, input: ListActivitiesInput
70107114
) -> ActivityExecutionAsyncIterator:
7011-
"""Called for every :py:meth:`Client.list_activities` call."""
7115+
"""Called for every :py:meth:`Client.list_activities` call.
7116+
7117+
.. warning::
7118+
This API is experimental.
7119+
"""
70127120
return self.next.list_activities(input)
70137121

70147122
async def count_activities(
70157123
self, input: CountActivitiesInput
70167124
) -> ActivityExecutionCount:
7017-
"""Called for every :py:meth:`Client.count_activities` call."""
7125+
"""Called for every :py:meth:`Client.count_activities` call.
7126+
7127+
.. warning::
7128+
This API is experimental.
7129+
"""
70187130
return await self.next.count_activities(input)
70197131

70207132
async def start_workflow_update(

temporalio/common.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ class WorkflowIDConflictPolicy(IntEnum):
157157
class IdReusePolicy(IntEnum):
158158
"""How already-closed entity IDs are handled on start.
159159
160+
.. warning::
161+
This API is experimental.
162+
160163
See :py:class:`temporalio.api.enums.v1.IdReusePolicy`.
161164
"""
162165

@@ -175,6 +178,9 @@ class IdReusePolicy(IntEnum):
175178
class IdConflictPolicy(IntEnum):
176179
"""How already-running entity IDs are handled on start.
177180
181+
.. warning::
182+
This API is experimental.
183+
178184
See :py:class:`temporalio.api.enums.v1.IdConflictPolicy`.
179185
"""
180186

@@ -193,6 +199,9 @@ class IdConflictPolicy(IntEnum):
193199
class ActivityExecutionStatus(IntEnum):
194200
"""Status of a standalone activity execution.
195201
202+
.. warning::
203+
This API is experimental.
204+
196205
See :py:class:`temporalio.api.enums.v1.ActivityExecutionStatus`.
197206
"""
198207

@@ -208,6 +217,9 @@ class ActivityExecutionStatus(IntEnum):
208217
class PendingActivityState(IntEnum):
209218
"""State of a pending activity.
210219
220+
.. warning::
221+
This API is experimental.
222+
211223
See :py:class:`temporalio.api.enums.v1.PendingActivityState`.
212224
"""
213225

0 commit comments

Comments
 (0)