Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2fd720f

Browse files
committed
Tweak bug fix
1 parent 59997c5 commit 2fd720f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

temporalio/client.py

+2
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,7 @@ async def _to_proto(
40474047
temporalio.converter.encode_search_attributes(
40484048
untyped_not_in_typed, action.start_workflow.search_attributes
40494049
)
4050+
# TODO (dan): confirm whether this be `is not None`
40504051
if self.typed_search_attributes:
40514052
temporalio.converter.encode_search_attributes(
40524053
self.typed_search_attributes, action.start_workflow.search_attributes
@@ -6531,6 +6532,7 @@ async def update_schedule(self, input: UpdateScheduleInput) -> None:
65316532
request_id=str(uuid.uuid4()),
65326533
)
65336534
if update.search_attributes is not None:
6535+
request.search_attributes.indexed_fields.clear() # Ensure that we at least create an empty map
65346536
temporalio.converter.encode_search_attributes(
65356537
update.search_attributes, request.search_attributes
65366538
)

temporalio/converter.py

-1
Original file line numberDiff line numberDiff line change
@@ -1151,7 +1151,6 @@ def encode_search_attributes(
11511151
DEPRECATED.
11521152
api: API message to set converted attributes on.
11531153
"""
1154-
api.indexed_fields.clear() # Ensure that we at least create an empty map
11551154
if isinstance(attributes, temporalio.common.TypedSearchAttributes):
11561155
for typed_k, typed_v in attributes:
11571156
api.indexed_fields[typed_k.name].CopyFrom(

0 commit comments

Comments
 (0)