Skip to content

False unsupported type error raised when using field attributes #824

Closed

Description

@ptwales

The following example results in a false type error: serde.compat.SerdeError: Unsupported type: Geometry

from dataclasses import dataclass

from serde import field, serde
from shapely import Geometry, from_wkt, to_wkt

@serde
@dataclass(frozen=True)
class Data:
    shape: Geometry | None = field(deserializer=from_wkt, serializer=to_wkt)

The bug was introduced in v0.29.0 with pull #694, which added early warning for unsupported types. Running version 0.28.0 doesn't result in any errors or unexpected behavior. It is my understanding that the early error feature simply isn't accounting for custom field attributes.

Activity

  1. added a commit that references this issue on Nov 8, 2026
    8ffd128
  2. yukinarit commented on Nov 8, 2026

    @yukinarit
    Owner

    @ptwales pyserde v0.35.1 was pushed to PyPI. Plz check.

  3. ptwales commented on Nov 15, 2026

    @ptwales
    Author

    0.35.1 works.

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

    bugBug report or fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions