Skip to content

Commit ae3b755

Browse files
committed
Honor search attributes in ScheduleUpdate
1 parent 61954ab commit ae3b755

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

temporalio/client.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4499,6 +4499,9 @@ class ScheduleUpdate:
44994499
schedule: Schedule
45004500
"""Schedule to update."""
45014501

4502+
search_attributes: Optional[temporalio.common.TypedSearchAttributes] = None
4503+
"""Search attributes to update."""
4504+
45024505

45034506
@dataclass
45044507
class ScheduleListDescription:
@@ -6520,14 +6523,19 @@ async def update_schedule(self, input: UpdateScheduleInput) -> None:
65206523
if not update:
65216524
return
65226525
assert isinstance(update, ScheduleUpdate)
6526+
request = temporalio.api.workflowservice.v1.UpdateScheduleRequest(
6527+
namespace=self._client.namespace,
6528+
schedule_id=input.id,
6529+
schedule=await update.schedule._to_proto(self._client),
6530+
identity=self._client.identity,
6531+
request_id=str(uuid.uuid4()),
6532+
)
6533+
if update.search_attributes is not None:
6534+
temporalio.converter.encode_search_attributes(
6535+
update.search_attributes, request.search_attributes
6536+
)
65236537
await self._client.workflow_service.update_schedule(
6524-
temporalio.api.workflowservice.v1.UpdateScheduleRequest(
6525-
namespace=self._client.namespace,
6526-
schedule_id=input.id,
6527-
schedule=await update.schedule._to_proto(self._client),
6528-
identity=self._client.identity,
6529-
request_id=str(uuid.uuid4()),
6530-
),
6538+
request,
65316539
retry=True,
65326540
metadata=input.rpc_metadata,
65336541
timeout=input.rpc_timeout,

0 commit comments

Comments
 (0)