Skip to content

Keep whole-number Double values in typed search attributes - #1957

Open
RaphaelFakhri wants to merge 1 commit into
temporalio:mainfrom
RaphaelFakhri:fix-double-search-attribute-whole-number
Open

RaphaelFakhri wants to merge 1 commit into
temporalio:mainfrom
RaphaelFakhri:fix-double-search-attribute-whole-number

Conversation

@RaphaelFakhri

Copy link
Copy Markdown
Contributor

What was changed

decode_typed_search_attributes() converts an int value to float when the key is a Double search attribute. Adds a unit test in tests/test_converter.py and a changelog fragment.

Why?

The visibility API returns a whole-number Double such as 5.0 as the JSON integer 5. The decoder read it as int, failed the isinstance(val, float) check and dropped the pair without an error, so list_workflows() results were missing the attribute from typed_search_attributes. describe() was not affected because it returns the payload the client sent.

The conversion only applies to Double keys and only to exact int values, so bool and every other type keep their current handling.

Checklist

  1. Closes [Bug] Whole-number Double search attributes are missing from list_workflows() typed search attributes #1956

  2. How was this tested:

    • New test test_decode_typed_search_attributes_whole_number_double decodes a Double payload with data 5. Without the source change it fails with assert None == 5.0. With the change it passes, and all 41 tests in tests/test_converter.py pass.
    • Against a local dev server, a workflow started with a Double search attribute of 5.0 now shows 5.0 in list_workflows() typed search attributes instead of None.
    • ruff check --select I, ruff format --check, pyright, basedpyright and mypy pass on the changed file.
  3. Any docs updates needed?
    No.

@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 10, 2026 19:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Whole-number Double search attributes are missing from list_workflows() typed search attributes

1 participant