MagicStack / MagicStack/asyncpg

asyncpg.exceptions.DataError: invalid input for query argument python

Open
#787 3 comments 1 reaction 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

I have a problem insert to PostgreSQL. The column I'm trying to insert is of type JSONB. The type of the object is Counter().

At production its working but locally I have a problem.

The error is: asyncpg.exceptions.DataError: invalid input for query argument $16: Counter({'clearmeleva': 1, 'cr7fragrance... (expected str, got Counter)

Why at prod is working and locally its throwing me this error ?

Thank you!

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

The report concerns inserting a Counter into a PostgreSQL JSONB column through asyncpg and shows an expected-str error. Start by comparing the local and production Python, asyncpg, and PostgreSQL versions, then reproduce the JSONB insertion locally with the reported Counter value. Done means identifying whether the discrepancy is environmental or an asyncpg defect and documenting a reproducible result.

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.