From 4fd5a34be436f65b207152e1cdf49bfd7c752eb1 Mon Sep 17 00:00:00 2001 From: Kevin Pham <161087761+accupham@users.noreply.github.com> Date: Mon, 2 Sep 2024 17:19:19 -0500 Subject: [PATCH] Insert guard clause for workflow.upsert_search_attributes on empty inputs Fix for https://github.com/temporalio/sdk-python/issues/629 --- temporalio/workflow.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/temporalio/workflow.py b/temporalio/workflow.py index 6ee25ad2..d00a8197 100644 --- a/temporalio/workflow.py +++ b/temporalio/workflow.py @@ -906,6 +906,8 @@ def upsert_search_attributes( DEPRECATED and if used, result in invalid key types on the typed_search_attributes property in the info. """ + if not attributes: + return temporalio.common._warn_on_deprecated_search_attributes(attributes) _Runtime.current().workflow_upsert_search_attributes(attributes)