[AP-2998] Handle Decimal objects in format_messages #167
Conversation
|
Comment
You can also request review from a specific team by commenting 💡 If you see something that doesn't look right, check the configuration guide. |
There was a problem hiding this comment.
Pull request overview
Changes: Bugfix (1), Maintenance (1)
This PR addresses a serialization gap introduced by using orjson: decimal.Decimal values inside Singer messages couldn’t be serialized. It adds an orjson default handler for decimals and bumps the package version / changelog for the release.
Changes:
- Add an
orjson.dumps(..., default=...)handler to convertdecimal.Decimalvalues tofloatduring message formatting. - Bump package version to
3.0.2. - Document the change in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| singer/messages.py | Adds a Decimal handler and wires it into format_message’s orjson.dumps call. |
| setup.py | Bumps package version to 3.0.2. |
| CHANGELOG.md | Adds a 3.0.2 entry describing the Decimal handling change. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Description of change
Context
Because the new version uses orjson, it does not handle decimal objects in the message.
This update adds a handler for decimal objects and convert them to float.
https://transferwise.atlassian.net/browse/AP-2998