Skip to content

DataType enum: reads raise ValueError on five documented wire type IDs #829

Description

@bgunebakan

Summary & Why It is important

Converter.get() resolves DataType(type_) before it can fall back to the default converter, so any column type identifier the enum doesn't list raises instead of passing the value through. Five documented IDs are missing:

  1. 17 INTERVAL
  2. 18 ROW
  3. 28 FLOAT_VECTOR
  4. 29 UUID
  5. 30 REGTYPE.

Impact

FLOAT_VECTOR is the sharp edge. Critically, users who never touch converters still hit this, setting cursor.time_zone implicitly constructs a Converter, so a timezone-aware cursor breaks on a vector column. A plain cursor is unaffected, which makes it look config-dependent to users.

Reproduction

Verified against a live CrateDB 6.4.3. I derived all five IDs from the server rather than trusting the docs table:

ID Type Statement Wire value
17 INTERVAL SELECT INTERVAL '1 day' "1 day 00:00:00"
18 ROW SELECT pg_get_keywords() LIMIT 1 ["over","U","unreserved"]
28 FLOAT_VECTOR SELECT embedding FROM t [0.1, 0.2]
29 UUID SELECT '…'::uuid "a5b3c1e0-…"
30 REGTYPE SELECT 23::regtype "int4"

All five fail on both the explicit-converter path and the time_zone=-only path. The plain-cursor control returns them fine.

Root cause

DataType(type_) is constructed to be used as a dict key, so an unlisted ID raises before self._default is reachable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions