Skip to content

[AP-2998] Handle Decimal objects in format_messages #167

Merged
amofakhar merged 5 commits intomasterfrom
AP-2998_decimal_handler
Apr 22, 2026
Merged

[AP-2998] Handle Decimal objects in format_messages #167
amofakhar merged 5 commits intomasterfrom
AP-2998_decimal_handler

Conversation

@amofakhar
Copy link
Copy Markdown
Contributor

@amofakhar amofakhar commented Apr 22, 2026

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

Copilot AI review requested due to automatic review settings April 22, 2026 15:42
@amofakhar amofakhar requested a review from a team as a code owner April 22, 2026 15:42
@platon-github-app-production
Copy link
Copy Markdown

Comment /request-review to automatically request reviews from the following teams:

You can also request review from a specific team by commenting /request-review team-name, or you can add a description with --notes "<message>"

💡 If you see something that doesn't look right, check the configuration guide.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 convert decimal.Decimal values to float during 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.

Comment thread singer/messages.py
Comment thread CHANGELOG.md Outdated
Comment thread singer/messages.py
amofakhar and others added 2 commits April 22, 2026 16:46
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@amofakhar amofakhar changed the title Ap 2998 decimal handler [AP-2998] Handle Decimal objects in format_messages Apr 22, 2026
@amofakhar amofakhar merged commit 1df8758 into master Apr 22, 2026
8 checks passed
@amofakhar amofakhar deleted the AP-2998_decimal_handler branch April 22, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants