-
Notifications
You must be signed in to change notification settings - Fork 279
EDU-3817: Use value_set/unset to update search attributes #3300
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EDU-3817: Use value_set/unset to update search attributes #3300
Conversation
|
Thanks for picking this up and tidying @fairlydurable :) |
|
@EddieWhi
So that means doing something like this is deprecated: workflow.upsert_search_attributes({"CustomKeywordField": ["new-value"]})However these methods aren't deprecated: I wonder if pyright is incorrectly reporting this? I couldn't reproduce the deprecation warning with pyright 0.8.0 installed in PyCharm. |
For reference, I ran the test using pyright v1.1.393 and python 3.12.3 Sorry if my original message wasn't clear. Explicitly, if I copy paste the example from the existing docs i.e. : I get the following from pyright: Although (from memory as I haven't taken the time to test again) it does actually work when run. For completeness, I tried the deprecated dictionary form you mentioned above ( Hope that helps in some way. |
|
Hi all! Just checking in for a status check on this ticket... |
|
arrrghhh took me 2h until I landed on this! LGTM |
|
Im still not sure how to set attributes with the new notation when start_child_workflow or start_workflows... the code in the documentation seems broken |
f38fe86 to
a838cca
Compare
|
@fairlydurable is attempting to deploy a commit to the Temporal Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Thank you, @EddieWhi - looks great! 🎉The code example given seems to use the correct typed pattern (value_set() / value_unset()), which is the preferred approach. Perhaps the dict-style call still type-checks and runs because it’s not programmatically marked as deprecated, but the Temporal Python SDK mark it as such in favor of the typed approach. Might need to do a docs sweep for any other non-typed forms in a separate PR. |
What does this PR do?
Update the docs for updating python search attributes.
Notes to reviewers
Stumbled across this issue when trying this out for the first time and deprecated method didn't cleanly validate through pyright. Assume this is the official mechanism for updating search attributes in python now?