Skip to content

bugfix/running-balance-ordering#196

Merged
fivetran-savage merged 10 commits intomainfrom
bugfix/running-balance-ordering
Feb 10, 2026
Merged

bugfix/running-balance-ordering#196
fivetran-savage merged 10 commits intomainfrom
bugfix/running-balance-ordering

Conversation

@fivetran-joemarkiewicz
Copy link
Contributor

@fivetran-joemarkiewicz fivetran-joemarkiewicz commented Feb 2, 2026

PR Overview

Package version introduced in this PR:

  • v1.4.1

This PR addresses the following Issue/Feature(s):

Summary of changes:

  • Ensures deterministic ordering of running_balance and running_converted_balance when multiple transactions occur on the same date for the same account and class combination

Submission Checklist

  • Alignment meeting with the reviewer (if needed)
    • Timeline and validation requirements discussed
  • Provide validation details:
    • Validation Steps: Check for unintentional effects (e.g., add/run consistency & integrity tests)
    • Testing Instructions: Confirm the change addresses the issue(s)
    • Focus Areas: Complex logic or queries that need extra attention
  • Merge any relevant open PRs into this PR

Changelog

  • Draft changelog for PR
  • Final changelog for release review

@fivetran-joemarkiewicz fivetran-joemarkiewicz self-assigned this Feb 2, 2026
@fivetran-joemarkiewicz fivetran-joemarkiewicz added the docs:ready Triggers the docs generator workflow. label Feb 2, 2026
@fivetran-joemarkiewicz fivetran-joemarkiewicz marked this pull request as ready for review February 2, 2026 20:05
Copy link
Contributor

@fivetran-avinash fivetran-avinash left a comment

Choose a reason for hiding this comment

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

Good for pre-release, one comment to consider for the future.

*,
sum(adjusted_amount) over (partition by account_id, class_id, source_relation
order by source_relation, transaction_date, account_id, class_id rows unbounded preceding) as running_balance,
order by source_relation, transaction_date, account_id, class_id, transaction_id, transaction_index rows unbounded preceding) as running_balance,
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not blocking for this pre-release, but I'm wondering if we should optimize these order bys in a future issue. should we be ordering by the same fields account_id, class_id, source_relation if they're already being used in the partition?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the same thought. The source_relation, account, and class order by fields are not necessary given they're included in the partition statement. I'd rather remove these unnecessary fields now and confirm this approach works than consider removing later.

Latest commit remove the unnecessary order by fields and ensures we are only ordering by what we absolutely need to.

@fivetran-joemarkiewicz fivetran-joemarkiewicz added docs:ready Triggers the docs generator workflow. and removed docs:ready Triggers the docs generator workflow. labels Feb 2, 2026
@fivetran-joemarkiewicz fivetran-joemarkiewicz added the pre-release Triggers the auto-releaser workflow. label Feb 3, 2026
@fivetran-savage fivetran-savage removed the pre-release Triggers the auto-releaser workflow. label Feb 6, 2026
Co-authored-by: fivetran-catfritz <111930712+fivetran-catfritz@users.noreply.github.com>
@fivetran-savage fivetran-savage merged commit 5a48673 into main Feb 10, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs:ready Triggers the docs generator workflow.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants