You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've just migrated over to beancount3, and while doing so I decided to move my importers over to use the new csvbase.Importer base class since the older csv base class has now been marked as deprecated.
Overall, this has been a great change - it's now much simpler to understand how to implement them, and they're much smaller now, so easier to understand what's going on.
The only issue I've encountered is that the automatic balance assertions always fail when there are multiple transactions on the last day of the csv's listings, since it takes the first entry in the last day. All of the csv files I have from my bank are in ascending date order, so this means that the balance is always off by the amount of the last transaction.
I've got a new (failing) test that reproduces the issue to communicate what it is that I mean here: rbrunt@528deba
I'm happy to write a tweak to csvbase.Importer to implement this behaviour how I would have expected it to work (to get this new test to pass), but before I do, I wanted to check if there were any views on approach: I don't want to change behaviour here and affect others who update to a new version because the base class has changed under them, but I also think this is likely to be catching quite a few people out.
The easiest approach would be to move from using max to a more explicit pick:
However this might break existing importers people have already written, so perhaps pulling this bit of code out into a separate function that can be overriden by a subclass or mixin would be a safer bet.
The text was updated successfully, but these errors were encountered:
I've just migrated over to beancount3, and while doing so I decided to move my importers over to use the new
csvbase.Importer
base class since the older csv base class has now been marked as deprecated.Overall, this has been a great change - it's now much simpler to understand how to implement them, and they're much smaller now, so easier to understand what's going on.
The only issue I've encountered is that the automatic balance assertions always fail when there are multiple transactions on the last day of the csv's listings, since it takes the first entry in the last day. All of the csv files I have from my bank are in ascending date order, so this means that the balance is always off by the amount of the last transaction.
I've got a new (failing) test that reproduces the issue to communicate what it is that I mean here: rbrunt@528deba
I'm happy to write a tweak to
csvbase.Importer
to implement this behaviour how I would have expected it to work (to get this new test to pass), but before I do, I wanted to check if there were any views on approach: I don't want to change behaviour here and affect others who update to a new version because the base class has changed under them, but I also think this is likely to be catching quite a few people out.The easiest approach would be to move from using
max
to a more explicit pick:However this might break existing importers people have already written, so perhaps pulling this bit of code out into a separate function that can be overriden by a subclass or mixin would be a safer bet.
The text was updated successfully, but these errors were encountered: