-
Notifications
You must be signed in to change notification settings - Fork 245
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-3995: Update Python docs: Pydantic support #3364
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick review! Pretty easy changes to make.
Data Converters convert raw Temporal payloads to/from actual Python types. | ||
A custom Data Converter of type `temporalio.converter.DataConverter` can be set via the `data_converter` client parameter. | ||
Data converters convert raw Temporal payloads to/from actual Python types. | ||
A custom Data Converter of type `temporalio.converter.DataConverter` can be set via the `data_converter` parameter of the `Client` constructor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
via -> 'through' or 'with'. We try to avoid latin terms.
A custom Data Converter of type `temporalio.converter.DataConverter` can be set via the `data_converter` client parameter. | ||
Data converters convert raw Temporal payloads to/from actual Python types. | ||
A custom Data Converter of type `temporalio.converter.DataConverter` can be set via the `data_converter` parameter of the `Client` constructor. | ||
Data converters are a combination of payload converters, payload codecs, and failure converters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any words in the glossary, we generally try to capitalize. Data Converter, Payload Codecs, and Failure Converters.
A custom Data Converter of type `temporalio.converter.DataConverter` can be set via the `data_converter` parameter of the `Client` constructor. | ||
Data converters are a combination of payload converters, payload codecs, and failure converters. | ||
Payload converters convert Python values to/from serialized bytes. | ||
Payload codecs convert bytes to bytes (e.g. for compression or encryption). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g -> For example. We avoid latin terms so it's clearer for more internationalization of the docs and it's a bit more translation friendly.
|
||
Although Workflows, Updates, Signals, and Queries can all be defined with multiple input parameters, users are strongly | ||
encouraged to use a single `dataclass` or Pydantic model parameter, so that fields with defaults can be easily added | ||
without breaking compatibility. Similar advice applies to return values. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We generally have every sentence on one line as a style so it's easier to comment on specific lines of text.
|
||
This Data Converter supports conversion of all types supported by Pydantic to and from JSON. | ||
|
||
In addition to Pydantic models, these include all `json.dump`-able types, various non-`json.dump`-able standard library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this sentence be made more clearer or broken up so it's more direct?
This PR updates the Python docs to cover the new Pydantic support.
This section was previously taken verbatim from the Python README (modulo Vale-isms) and this PR does the same.