Cannot create type codec for composite type with certain field types.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by reproducing the example through conn.set_type_codec with a composite type containing a jsonb field, then inspect the composite codec handling and PostgreSQL type-format constraints. Done means establishing support for the reported field types or clearly documenting the limitation and a supported workaround.
Written by the indexing model from the issue text.
Description
Hello, I noticed I can't create a type codec for a composite type if it has a field of type json, a jsonb or a geometry type. Why is so and is there a way to sidestep this issue?
import json
from dataclasses import dataclass
@dataclass
class Foo:
data: dict
await conn.execute("CREATE TABLE foo (data jsonb NOT NULL);")
await conn.set_type_codec(
"foo",
schema="public",
encoder=lambda foo: (json.dumps(foo.data),),
decoder=lambda row: Foo(json.loads(row)),
format="tuple",
)
UnsupportedClientFeatureError: cannot decode type "public"."foo": text encoding of composite types is not supported
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 469
- Avg merge
- 4h 42m
- Merged PRs (30d)
- 6
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.
More from MagicStack/asyncpg
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
MagicStack/asyncpg#1357 ·
-
tests fail in 2032 Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
MagicStack/asyncpg#997 ·
-
Connection.close(timeout=) waits forever on a pending cancel when the server never acknowledges it Open
Difficulty 4/5 3-5 days Newbie friendliness 68/100
MagicStack/asyncpg#1356 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
MagicStack/asyncpg#1354 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
MagicStack/asyncpg#1342 ·
All issues in MagicStack/asyncpg
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·