MagicStack / MagicStack/asyncpg
[Question] Generate Record from Record subset of keys?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
Hi guys!
Really great library, well done and hats off to you.
Just a small question: can I generate a Record from a subset of another Record's keys? e.g.:
record: Record = conn.fetchrow(query, foo)
print(len(record.keys()) # let's say there are 10 keys
# Make a new Record from the first 8 keys
new_record = Record(record[:8])
The reason I can't just cast the original Record to a dict is because it was generated using 2 INNER JOINs onto the same table, and so I have non-unique column descriptions in the result from that query.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with asyncpg's Record API and the conn.fetchrow result described in the example; the issue names no source files or tests. Determine whether constructing a Record from a subset of keys is supported, and clarify the supported approach for results with duplicate column names.
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
- 25/100