sdk-python icon indicating copy to clipboard operation
sdk-python copied to clipboard

[Bug] workflow.upsert_search_attributes() will bork SDK on empty inputs

Open irdbl opened this issue 1 year ago • 1 comments

In the middle of a workflow, if you call upsert_search_attributes with an empty input:

empty = []
workflow.upsert_search_attributes(empty)

You'll get a completely inscrutable and hard to debug error like so:

Failed completing activation on workflow with run ID 27fa7d71-76a8-4b3b-be33-1e0d11afc5a4
Traceback (most recent call last):
  File ".../.venv/lib/python3.12/site-packages/temporalio/worker/_workflow.py", line 320, in _handle_activation
    await self._bridge_worker().complete_workflow_activation(completion)
  File ".../.venv/lib/python3.12/site-packages/temporalio/bridge/worker.py", line 117, in complete_workflow_activation
    await self._ref.complete_workflow_activation(comp.SerializeToString())
RuntimeError: Completion failure: Lang SDK sent us a malformed workflow completion for run (27fa7d71-76a8-4b3b-be33-1e0d11afc5a4): At least one workflow command in the completion contained an empty variant

irdbl avatar Sep 02 '24 22:09 irdbl

Saw the attached PR, thanks!

cretz avatar Sep 03 '24 13:09 cretz