Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

adding pascal case to status#1213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
jhammarstedt wants to merge2 commits intotemporalio:main
base:main
Choose a base branch
Loading
fromjhammarstedt:add_pascal_case_to_status_enum

Conversation

@jhammarstedt
Copy link

What was changed

Added ato_pascal_case property to theWorkflowExecutionStatus enum class that converts enum names to PascalCase format required by Temporal search attributes. The property converts enum names likeTIMED_OUT to"TimedOut" andCONTINUED_AS_NEW to"ContinuedAsNew".

Why?

Temporal search attributes expect execution status values in PascalCase format without underscores. Previously, users had to manually convert enum names when filtering workflows by execution status using search attributes. This property eliminates the need for manual conversion and provides a convenient, consistent way to get the correctly formatted string.

Example usage:

fromtemporalio.clientimportWorkflowExecutionStatusstatus=WorkflowExecutionStatus.TIMED_OUTsearch_value=status.to_pascal_case# Returns "TimedOut"# Can now use search_value in search attribute filters

Checklist

  1. ClosesAdd pascalcase to WorkflowExecutionStatus #1212

  2. How was this tested:

Added unit testtest_workflow_execution_status_search_attribute_value() intests/test_client.py that verifies correct PascalCase conversion for allWorkflowExecutionStatus enum values:

  • RUNNING"Running"
  • COMPLETED"Completed"
  • FAILED"Failed"
  • CANCELED"Canceled"
  • TERMINATED"Terminated"
  • TIMED_OUT"TimedOut"
  • CONTINUED_AS_NEW"ContinuedAsNew"

The test can be run with:

pytest tests/test_client.py::test_workflow_execution_status_search_attribute_value -v
  1. Any docs updates needed?

No documentation updates needed. This is a straightforward addition to an existing enum class that follows standard Python property patterns.

@jhammarstedtjhammarstedt requested a review froma team as acode ownerNovember 13, 2025 17:09
@CLAassistant
Copy link

CLAassistant commentedNov 13, 2025
edited
Loading

CLA assistant check
All committers have signed the CLA.

)

@property
defto_pascal_case(self)->str:
Copy link
Member

@cretzcretzNov 13, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Hrmm, even though it's the case that this enumerate returned from describe/list happens to have the same values in a different format as the search attribute, not sure we want to guarantee that will always be the case. We intentionally document the explicit set of enumerate strings athttps://docs.temporal.io/search-attribute#default-search-attribute without reference to this enumerate, but it's technically possible that list could change unrelated to this enumerate (even if it happens to match today even in server code). Most (all?) parts of the list filter/query don't have non-string-literal representations in SDKs at this time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Understandable, would it make more sense to have something as part of the search attributes then?

That way, you would not introduce a breaking change if you change the format and update the property/function? Just thought it seemed strange that your own types would not work as search attributes out of the box.

Copy link
Member

@cretzcretzNov 14, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

There are a couple of search attributes that have pre-defined enumerates (e.g.TemporalWorkflowVersioningBehavior in addition to this one), but the actual type is trulyKeyword which is a string. I think, in the absence of a type safe query builder or even a predefined set ofSearchAttributeKeys for all of the built-in search attributes, we currently recommend using the string format only for keys/values for list filters based on expectations in the doc instead of hardcoded SDK-side expectations.

We can keep an issue open for if/when we do decide to provide type safe assistance to building of list filters (not just enumerates, but the predefined typed key set,TemporalWorkerDeploymentVersion parsing, conditional/query building, string escaping, etc). And we would of course do it across every SDK for parity not just Python.

jhammarstedt reacted with thumbs up emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cretzcretzcretz left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add pascalcase to WorkflowExecutionStatus

3 participants

@jhammarstedt@CLAassistant@cretz

[8]ページ先頭

©2009-2025 Movatter.jp