asyncpg icon indicating copy to clipboard operation
asyncpg copied to clipboard

cant pickle asyncpg.record

Open crazyhouse33 opened this issue 5 years ago • 5 comments

Hi, I would like to know what make a record not picklable and if you have a solution to do what I want to do. Basically I am doing a program that use persistent sessions: in case of crash, the programs save its state on the disk. Next lunch wont redo what it did before with success

I implement that with a global try except. I put my python "Session class" on disk, and retrieve it with pickle. One of Session class attribute is a list of record I gather at the start and I need for the rest of the session. However, I got a "cant pickle asyncpg.record" error which prevent me to do that.

The problem is that I also cant make a record object from python, accordingly to the doc. So I cant see any workaround like casting to dict before serialization and casting to record after

crazyhouse33 avatar Jun 05 '19 16:06 crazyhouse33

Yes, we can add support for pickling.

1st1 avatar Jun 06 '19 12:06 1st1

Just got this "cant pickle asyncpg.record" error, I am wondering is there a progress on this support?

bofeng avatar Sep 13 '20 15:09 bofeng

@1st1 hi! Is there any timelines about that feature going live? Thanks!

wvolkov avatar Jan 13 '21 16:01 wvolkov

Any news about it?

Feijo avatar May 02 '21 07:05 Feijo

I am backporting this feature from our company's optimized fork: https://github.com/MagicStack/asyncpg/pull/1000

vmarkovtsev avatar Feb 08 '23 18:02 vmarkovtsev