Repository navigation
fix: preserve fractional invoice line unit prices - #163
Merged
fivetran-jamie merged 1 commit intoOct 20, 2026
Merged
fivetran-jamie merged 1 commit into
fivetran-jamie merged 1 commit into
Conversation
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
approved these changes
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.