On 07/07/24 14:06, Stefano Zacchiroli wrote:
Back then (v2) one should inherit from ImporterProtocol, whereas now (v3) one should inherit from beangulp.Importer, like in the examples; correct?
This is optional. If the machinery is passed importers that implement ImporterProtocol it wraps them into an adapter that implements the new interface. I cannot exclude there are bugs, though.
The traceback has a bug in the exception message, for a start.
But then, if I change my hierarchy to match, I get an even nastier type error in the same place: TypeError: expected bengulp.Importer not <class 'abc.ABCMeta'>
This is a funny one, but without more details it is hard for me to understand where this is coming from. It is a long while since I put that code together. If you can share your importer code or (even better) a minimal example that demonstrates the issue, I can have a closer look.
I'm tempted at this point to nuke everything and restart from scratch using the new csvbase.Importer. But maybe I'm missing something about why the trivial migration that you were suggesting isn't working in my case.
It should work. I'm adding a test to check if it actually works. Cheers, Dan -- 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/a42f872d-abfd-4404-8e95-70078bf4cd48%40grinta.net.