Skip to content

deps: bump decimal to 3.1#92

Closed
DaemonSnake wants to merge 1 commit into
agoodway:masterfrom
tryriot:bump-decimal
Closed

deps: bump decimal to 3.1#92
DaemonSnake wants to merge 1 commit into
agoodway:masterfrom
tryriot:bump-decimal

Conversation

@DaemonSnake

@DaemonSnake DaemonSnake commented May 28, 2026

Copy link
Copy Markdown
Contributor

Decimal v3 applies decimal128 parse limits (34 digits, exp ±6144) via Decimal.new/1, which raises on large Postgres numeric values. Parse with max_digits/max_exponent: :infinity to keep arbitrary-precision casting.

Pulls postgrex 0.22.2, whose constraint allows decimal ~> 3.0.

Summary by CodeRabbit

  • Improvements

    • Centralized decimal parsing options for more consistent and reliable handling of PostgreSQL numeric and money values, including single values and arrays.
  • Chores

    • Bumped Decimal dependency from ~> 2.3.0 to ~> 3.1 (override enabled).

Review Change Stack

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: ea7654c0-d832-469c-b1e3-f45c28b198bf

📥 Commits

Reviewing files that changed from the base of the PR and between 04427d9 and dc8d871.

⛔ Files ignored due to path filters (1)
  • mix.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • lib/walex/casting/types.ex
  • mix.exs
✅ Files skipped from review due to trivial changes (1)
  • mix.exs
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/walex/casting/types.ex

📝 Walkthrough

Walkthrough

WalEx centralizes Decimal parsing options via a module attribute and applies unbounded-precision options across numeric, money, and array casting paths. The :decimal dependency is upgraded to ~> 3.1 with override: true.

Changes

Decimal Arbitrary-Precision Support

Layer / File(s) Summary
Decimal precision configuration and dependency upgrade
lib/walex/casting/types.ex, mix.exs
@decimal_opts module attribute configures Decimal.new/2 with unbounded max_digits and max_exponent. The :decimal dependency is upgraded from ~> 2.3.0 to ~> 3.1 with override: true.
Apply decimal options across casting paths
lib/walex/casting/types.ex
PostgreSQL casts for "numeric", "money", "_numeric", and "_money" now use Decimal.new(value, @decimal_opts) (or the appropriate two-argument form) instead of the default Decimal.new/1 to preserve arbitrary precision.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With tiny paws I tweak the code tonight,

decimals unbound, every digit bright.
From numeric fields to money arrays,
I hop through digits in joyful craze.
Precision preserved — a rabbit's delight.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'deps: bump decimal to 3.1' directly and clearly describes the primary change in the pull request, which is updating the Decimal dependency version.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

Decimal v3 applies decimal128 parse limits (34 digits, exp ±6144) via
Decimal.new/1, which raises on large Postgres numeric values. Parse with
max_digits/max_exponent: :infinity to keep arbitrary-precision casting.

Pulls postgrex 0.22.2, whose constraint allows decimal ~> 3.0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Actionable comments posted: 0

@DaemonSnake DaemonSnake deleted the bump-decimal branch May 28, 2026 10:51
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.

1 participant