Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kaiwei opened this issue Oct 21, 2023 · 5 comments

Comments

@kaiwei
Copy link

kaiwei commented Oct 21, 2023

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'

@kaiwei kaiwei changed the title stanchart importer error - '<' not supported between instances of 'method' and 'datetime.date' stanchart & uob importer error - '<' not supported between instances of 'method' and 'datetime.date' Oct 21, 2023
@kaiwei kaiwei changed the title stanchart & uob importer error - '<' not supported between instances of 'method' and 'datetime.date' stanchart & uob (both) importer error - '<' not supported between instances of 'method' and 'datetime.date' Oct 21, 2023
@redstreet
Copy link
Owner

redstreet commented Oct 21, 2023

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
Copy link
Author

kaiwei commented Oct 22, 2023

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
Copy link
Owner

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

@kaiwei
Copy link
Author

kaiwei commented Oct 23, 2023

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

@kaiwei kaiwei closed this as completed Oct 23, 2023
@redstreet redstreet reopened this Oct 23, 2023
@redstreet
Copy link
Owner

redstreet commented Oct 23, 2023

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

  • uob card
  • uob srs
  • scb bank
  • scb card

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 :).

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

No branches or pull requests

2 participants