MagicStack / MagicStack/asyncpg

cant pickle asyncpg.record

Open
#451 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
8.1k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the reported pickle failure with the asyncpg record objects stored in the Session class, then review the asyncpg record documentation referenced by the report. Done should be a confirmed explanation of the limitation and a documented, supported workaround or serialization path.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.