MagicStack / MagicStack/asyncpg
copy_from_query output function receives bytearray
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](https://github.com/magicstack/uvloop)?**: Could not try without uvloop because of https://github.com/MagicStack/asyncpg/issues/240
Hi! The [documentation](https://magicstack.github.io/asyncpg/current/api/index.html?highlight=copy_from_query#asyncpg.connection.Connection.copy_from_query) 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
- 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 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