Skip to content
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-3747: [ Documentation request ] Update Message Handler coverage to clarify use of data class parameters #3278

Open
antmendoza opened this issue Jan 7, 2025 · 1 comment
Labels
cross-team This issue or PR was submitted from within Temporal tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR

Comments

@antmendoza
Copy link
Member

Brief description

https://docs.temporal.io/develop/python/message-passing#writing-message-handlers

Prefer [data classes](https://docs.python.org/3/library/dataclasses.html) to multiple input parameters. Data class parameters allow you to add fields without changing the calling signature.

While this is true, it can get the reader the impression that adding fields to dataclasses will always work. However, in reality, they could encounter serialization/deserialization issues.

Your recommended content

We should add that serialization/deserialization can fail with the default data converter if the new field does not have a default value.

@fairlydurable
Copy link
Contributor

Great suggestion. Thanks for submitting it. Tracking as EDU-3747.

@fairlydurable fairlydurable changed the title [ Documentation request ] improve documentation EDU-3747: [ Documentation request ] improve documentation Jan 7, 2025
@fairlydurable fairlydurable added the tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR label Jan 9, 2025
@sync-by-unito sync-by-unito bot changed the title EDU-3747: [ Documentation request ] improve documentation EDU-3747: [ Documentation request ] Update Message Handler coverage to clarify use of data class parameters Jan 10, 2025
@fairlydurable fairlydurable added the cross-team This issue or PR was submitted from within Temporal label Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-team This issue or PR was submitted from within Temporal tracking-internally A JIRA ticket has been generated and the EDU number is attached to the title of this issue or PR
Projects
None yet
Development

No branches or pull requests

2 participants