redstreet/beancount_reds_importers

Filing account incorrect with schwab_csv_brokerage

Closed this issue · 3 comments

Filing account when filed via bean-file is Assets:Investments:Taxable:Broker:{ticker}.

In 7e5caf3, this change was made:

When bean-file is called, filing_account has not been set (since initialize() is not run on a bean-file invoke), and main_account is used, which results in: Assets:Investments:Taxable:Broker:{ticker}.

I just encountered this myself, realizing I hadn't used bean-file when testing my change. Thank you for fixing before I even started debugging! I'm also surprised the regression test didn't catch this so I'll pay attention to #73.

Ha, yes, a root issue here was Beancount's regression tester not matching how bean-file calls file_account, else the unit tests would've caught this. I'm a bit surprised at that, but realized that Beancount's inbuilt importers are basic, and don't rely on initialization like we do here.

#73 might need either an upstream change, or a bit of thinking on how to circumvent this in beancount_reds_importers, so I might not get to it for a while. But at least we know exactly what the issue is :).

Unrelated to this thread, but thanks for the initial set of unit tests you submitted a couple months ago. That had been pending for a while, and was a much needed push!