Skip to content

fix(csvbase): do not persist auto-detected self.order#161

Merged
blais merged 2 commits intobeancount:masterfrom
wzyboy:fix/csvbase-importer-order-detection
Mar 19, 2025
Merged

fix(csvbase): do not persist auto-detected self.order#161
blais merged 2 commits intobeancount:masterfrom
wzyboy:fix/csvbase-importer-order-detection

Conversation

@wzyboy
Copy link
Copy Markdown
Contributor

@wzyboy wzyboy commented Mar 19, 2025

Today when I batch import two years of statements for a rarely-used account, I find this auto detection of row order might produce incorrect results.

For example, there is only one transaction in January:

2023-01-31,...

... and four transactions in February:

2023-02-28,...
2023-02-20,...
2023-02-11,...
2023-02-05,...

When processing the January file, the code auto-detects the order as ASCENDING as there is only one transaction, and for Feburary and any subsequent files, the code no longer tries to detect the order because self.order is already set. But this bank actually uses DESCENDING order for their files.

This error might be masked if the entries are eventually sorted. But I disabled sorting for some other reason so I hit this edge case.

@wzyboy wzyboy force-pushed the fix/csvbase-importer-order-detection branch from 2e0cfe4 to 3ec3599 Compare March 19, 2025 01:10
@blais blais merged commit 519cc46 into beancount:master Mar 19, 2025
19 checks passed
@wzyboy wzyboy deleted the fix/csvbase-importer-order-detection branch March 19, 2025 04:33
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.

2 participants