MagicStack / MagicStack/asyncpg

copy_from_query output function receives bytearray

Open
#902 0 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

  • asyncpg version: 0.25.0
  • PostgreSQL version: 13.4 (Ubuntu 13.4-1.pgdg21.04+1) + Timescale 2.4.2
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    :
  • Python version: 3.9.7
  • Platform: Ubuntu 21.10
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?:
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : Could not try without uvloop because of https://github.com/MagicStack/asyncpg/issues/240

Hi! The documentation states that a coroutine function passed as output argument will receive a bytes argument, but when I do this I get bytearray. Seems like a bug either with documentation or the code.

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 Connection.copy_from_query entry point and its API documentation, which state that the output coroutine receives bytes. Trace the value passed to output and compare it with the documented behavior. Done means confirming whether the code or documentation is incorrect and covering the agreed behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql, python
Domain
databases
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.