MagicStack / MagicStack/asyncpg

TypeError: can't set attributes of built-in/extension type 'asyncpg.Record'

Open
#452 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.1k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Hi, I am trying to monkey patch the Record class (the getter) to get an history of every column that got accessed in the record (to only query what the user really need for the next n queries). However I cant do that, I got the error of the title.

I am pretty sure this is related to https://github.com/MagicStack/asyncpg/issues/451 and the strange nature of Record object.

I would like to know why Records are made like that and if you will change that. Right now I think I will re implement my driver class with another library if you dont have any workaround

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the asyncpg.Record class and its getter behavior, then read the related asyncpg issue #451. Determine whether supporting attribute changes or exposing access tracking is in scope; done would be a maintainer decision and a documented supported approach or explicit explanation of the limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.