Hello there, A few observations:
1. AFAIK, Beancount doesn’t support timestamps <https://beancount.github.io/docs/a_comparison_of_beancount_and_ledger_hledger.html#language-syntax>. Please correct me if this is out of date. 2. With the change you made to ofxreader, it ends up emitting a datetime instead of a date, which would break with anything downstream that expects a date (and correctly so). Instead of making this change, you'd have to root cause the issue and resolve it correctly. If you need help, feel free to post a test case and a stack trace and I'll take a look when I'm able 3. Are you using the latest, (unreleased) commit with beancount_reds_importers? If not, please try that out first, it fixes a related issue On Monday, February 19, 2024 at 6:27:15 AM UTC-8 marcio...@gmail.com wrote: > Hi, > > I'm taking up beancount again after some 2 years away from it. My biggest > difficulty had then been importing bank and brokers' statements to > beancount. I was getting the best results with (modified) reds_importers + > smart_importer, which came to work reasonably well. But I'm realizing that > retaking from where I left off will not be as simple as I wished. > > I'm getting the error in the subject line. I suppose this error was > introduced for two reasons (please confirm): > > 1) Martin, at some point, agreed to include, not only date, but also time > of transactions, according to requests from users interested in daytrading > (which I am too, and welcomed his decision). Martin didn't see then any > reason why this would cause inconsistencies in beancount. I don't remember > it causing any issues with reds_importers, fava, smart_importer either. > > 2) Some later python release made the comparison between datetime.date and > datetime.datetime incompatible. This comparison is needed in the > chronological ordering of transactions. > > I first got this error in reds_importers and think I managed to fix it by > making the simple change in ofxreader.py: > > from: > > date = max(ot.tradeDate if hasattr(ot, 'tradeDate') else ot > .date > for ot in self.get_transactions()).date() > > to: > > date = max(ot.tradeDate if hasattr(ot, 'tradeDate') else ot > .date > for ot in self.get_transactions()) #.date() > > But then I started getting the same error message from smart_importer, > which makes me think I should be better to avoid the python version update > that made date and datetime incomparable. > > Any suggestions? Which python version is the latest that doesn't cause > this kind of error? Has anyone else encountered these issues? I searched > the forum and the internet and didn't find anything. > > Thanks > > Marcio > -- You received this message because you are subscribed to the Google Groups "Beancount" group. To unsubscribe from this group and stop receiving emails from it, send an email to beancount+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/70a6b74a-0ed5-4ac8-9cc5-e736b1b6299en%40googlegroups.com.