{"record":{"id":"02f09fd5ffc1d909","repo":"pathwaycom/pathway","slug":"unsupported-type-input-type-r","errorCode":null,"errorMessage":"Unsupported type {input_type!r}.","messagePattern":"Unsupported type (.+?)\\.","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"python/pathway/internals/dtype.py","lineNumber":766,"sourceCode":"        (arg,) = args\n        return Future(wrap(arg))\n    else:\n        dtype = {\n            int: INT,\n            bool: BOOL,\n            str: STR,\n            float: FLOAT,\n            datetime_types.Duration: DURATION,\n            datetime_types.DateTimeNaive: DATE_TIME_NAIVE,\n            datetime_types.DateTimeUtc: DATE_TIME_UTC,\n            np.int32: INT,\n            np.int64: INT,\n            np.float32: FLOAT,\n            np.float64: FLOAT,\n            bytes: BYTES,\n        }.get(input_type, None)\n        if dtype is None:\n            raise TypeError(f\"Unsupported type {input_type!r}.\")\n        return dtype\n\n\nANY_TUPLE: DType = List(ANY)\nANY_ARRAY: DType = Array(n_dim=None, wrapped=ANY)\nANY_ARRAY_1D: DType = Array(n_dim=1, wrapped=ANY)\nANY_ARRAY_2D: DType = Array(n_dim=2, wrapped=ANY)\nINT_ARRAY: DType = Array(n_dim=None, wrapped=INT)\nINT_ARRAY_1D: DType = Array(n_dim=1, wrapped=INT)\nINT_ARRAY_2D: DType = Array(n_dim=2, wrapped=INT)\nFLOAT_ARRAY: DType = Array(n_dim=None, wrapped=FLOAT)\nFLOAT_ARRAY_1D: DType = Array(n_dim=1, wrapped=FLOAT)\nFLOAT_ARRAY_2D: DType = Array(n_dim=2, wrapped=FLOAT)\n\n\ndef dtype_equivalence(\n    left: DType, right: DType, int_float_compatible: bool = True\n) -> bool:","sourceCodeStart":748,"sourceCodeEnd":784,"githubUrl":"https://github.com/pathwaycom/pathway/blob/fa2f74a4649b7c5908690cf60137263d8d80de5f/python/pathway/internals/dtype.py#L748-L784","documentation":"This TypeError is the catch-all branch of Pathway's dtype translation: the input type is not any of the recognized primitives (int, str, float, bool, bytes, Duration, DateTimeNaive/Utc, numpy scalars, and the composite types handled earlier). It means the type you declared for a column or annotation has no Pathway dtype mapping.","triggerScenarios":"Schema fields annotated with unmapped stdlib/3rd-party types such as datetime.date, datetime.time, decimal.Decimal, complex, dict, set, or custom classes (not wrapped in pw.PyObjectWrapper); numpy types other than int32/int64/float32/float64; Optional[X] where X itself is unmapped.","commonSituations":"Reusing pydantic/dataclass models directly as schemas; annotating with datetime.date (common mistake — only DateTimeNaive/Utc exist); large custom classes expected to 'just work'; version changes that tightened accepted types.","solutions":["Check the message's repr of the type against Pathway's supported list and switch to a supported dtype (e.g. datetime.date -> pw.DateTimeNaive, Decimal -> float or str)","Wrap genuinely arbitrary python objects with pw.PyObjectWrapper[YourClass] (or pw.Json for JSON-serializable payloads)","For containers, use explicit generic forms Pathway understands (pw.Json, tuple[...], list not supported -> use pw.Json or arrays)"],"exampleFix":"// before\nfrom decimal import Decimal\nclass Orders(pw.Schema):\n    total: Decimal\n// after\nclass Orders(pw.Schema):\n    total: pw.PyObjectWrapper[Decimal]  # or float, or pw.Json","handlingStrategy":"type-guard","validationCode":"import datetime\n\nSUPPORTED = {int, float, str, bool, bytes}\n\ndef assert_supported(annotation, name=\"field\"):\n    if annotation not in SUPPORTED and not str(annotation).startswith(\"pathway\"):\n        raise TypeError(f\"{name}: unsupported annotation {annotation!r}; wrap with pw.PyObjectWrapper or use a pathway dtype\")","typeGuard":"def is_pathway_compatible(tp) -> bool:\n    import pathway as pw\n    known = {int, float, str, bool, bytes, pw.DateTimeUtc, pw.DateTimeNaive, pw.Duration, pw.Json}\n    return tp in known or str(getattr(tp, '__origin__', tp)).startswith(('pathway', 'typing.Optional'))","tryCatchPattern":"try:\n    pw.schema_from_types(**fields)\nexcept TypeError as e:\n    if \"Unsupported type\" in str(e):\n        # fall back to pw.PyObjectWrapper for the offending fields\n        ...","preventionTips":["Restrict schema annotations to Pathway's documented dtypes","Wrap arbitrary objects in pw.PyObjectWrapper and JSON-like payloads in pw.Json","Remember datetime.date/time and Decimal have no direct dtype"],"tags":["pathway","dtype","unsupported-type","schema","type-system"],"backgroundTag":null,"analyzedSha":"fa2f74a4649b7c5908690cf60137263d8d80de5f","analyzedAt":"2026-08-15T01:48:17.006Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}