Skip to content

fix: preserve fractional invoice line unit prices - #163

Merged
fivetran-jamie merged 1 commit into
fivetran:release/v1.10.2from
Bortlesboat:fix/fractional-unit-prices-model-only
Oct 20, 2026
Merged

fivetran-jamie merged 1 commit into
fivetran:release/v1.10.2from
Bortlesboat:fix/fractional-unit-prices-model-only

Conversation

@Bortlesboat

Copy link
Copy Markdown
Contributor

Resolves #159

Supersedes #160 with the SQL-only scope requested by @fivetran-joemarkiewicz in #159 (comment).

Please provide your name and company

Bortlesboat, contributing independently.

Describe what this PR changes and how it addresses the linked issue or feature request.

Cast the invoice line amount to the existing numeric type before dividing by quantity in stripe__line_item_enhanced. PostgreSQL otherwise truncates integer division, so an amount of 21 with quantity 5 produces 4 instead of 4.2. Negative fractional prices are preserved too; zero-quantity handling and currency conversion are unchanged.

This PR changes only models/standardized_models/stripe__line_item_enhanced.sql. The earlier fixtures, regression test and generated docs remain available in #160 for the team's review process.

How did you validate the changes introduced within this PR, and what warehouse did you use for testing?

Retested the identical model file on PostgreSQL 16 using the synthetic integration fixtures from #160: 78 build nodes and all 16 tests pass. With currency conversion enabled, the focused dependency build passes all 44 nodes. The original regression failed on three fractional values before the fix and passed afterward. Positive, negative, zero-amount and zero-quantity cases are covered.

Cloud warehouses and full DuckDB execution remain unverified.

@fivetran-jamie
fivetran-jamie changed the base branch from main to release/v1.10.2 October 20, 2026 18:47
@fivetran-jamie

Copy link
Copy Markdown
Contributor

Hey @Bortlesboat this looks great! Going to merge this into my release branch, apply some polishes, and deploy as v1.10.2

@fivetran-jamie
fivetran-jamie merged commit d507dab into fivetran:release/v1.10.2 Oct 20, 2026
@fivetran-jamie fivetran-jamie mentioned this pull request Oct 20, 2026
2 of 9 tasks
fivetran-jamie added a commit that referenced this pull request Oct 21, 2026
* fix: preserve fractional invoice line unit amounts (#163)

* stage for release

* Generate dbt docs via GitHub Actions

---------

Co-authored-by: Andrew Barnes <169967362+Bortlesboat@users.noreply.github.com>
Co-authored-by: fivetran-data-model-bot <fivetran-data-model-bot@users.noreply.github.com>
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.

[Bug] Fractional unit prices are truncated on PostgreSQL

2 participants