redstreet / beancount_reds_importers

Simple ingesting tools for Beancount (plain text, double entry accounting software). More importantly, a framework to allow you to easily write your own importers.
GNU General Public License v3.0
115 stars 39 forks source link

stanchart & uob (both) importer error - '<' not supported between instances of 'method' and 'datetime.date' #85

Closed kaiwei closed 1 year ago

kaiwei commented 1 year ago

Running the latest importer version for scbbank. Ran into the error below when importing as usual this month. Same error for all csv files. Even re-tried importing old csv files which ran fine before but generate this error now.

ERROR:root:Importer beancount_reds_importers.importers.stanchart.scbbank.Importer.extract() raised an unexpected error: '<' not supported between instances of 'method' and 'datetime.date'

redstreet commented 1 year ago

Does it work with the latest released version (0.7.1)?

Also, would you mind sending the full stacktrace, and a single row of csv input that breaks? Thanks!

kaiwei commented 1 year ago

Works perfectly fine in 0.7.1 when I downgraded back to that. Full terminal output below. Will try to see if I can figure out the single row which is causing the error but in 0.7.2, seems to be affecting every single csv & xls (both SCB & UOB) file I feed it.

Thank you for the help as always!

ERROR:root:Importer beancount_reds_importers.importers.stanchart.scbbank.Importer.extract() raised an unexpected error: '<' not supported between instances of 'method' and 'datetime.date'
Traceback (most recent call last):
  File "[local file path]/.local/lib/python3.11/site-packages/beancount/ingest/extract.py", line 182, in extract
    new_entries = extract_from_file(
                  ^^^^^^^^^^^^^^^^^^
  File "[local file path]/.local/lib/python3.11/site-packages/beancount/ingest/extract.py", line 72, in extract_from_file
    new_entries.sort(key=data.entry_sortkey)
TypeError: '<' not supported between instances of 'method' and 'datetime.date'
**** [local file path]/documents/beancount/ingest/AccountTransactions231021134659943530037.csv
Importer:    beancount_reds_importers.importers.stanchart.scbbank.Importer
Account:     Assets:Investments:SCB:XXXXXX
Date:        2023-10-13 (from contents)
Destination: [local file path]/documents/beancount/ingest/filings/Assets/Investments/SCB/2023-10-13.AccountTransactions231021134659943530037.csv
redstreet commented 1 year ago

No problem, and I'm able to reproduce it. Will fix it soon.

kaiwei commented 1 year ago

Thank you as always! Will stick to 0.7.1 till then.

redstreet commented 1 year ago

Fixed, thanks for filing. This escaped the unit tests because unit tests don't yet exist for:

Here, the unit test case that you sent for uob bank was very helpful. Whenever you can, if you could please send similar cases for the above four (with anonymized data, of course), then I'll setup the unit tests that will help avoid these in the future :).