{"record":{"id":"0cbd93916189940f","repo":"apache/beam","slug":"no-logical-type-registered-for-typing-s","errorCode":null,"errorMessage":"No logical type registered for typing '%s'","messagePattern":"No logical type registered for typing '(.+?)'","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/typehints/schemas.py","lineNumber":900,"sourceCode":"  def register_logical_type(cls, logical_type_cls):\n    \"\"\"Register an implementation of LogicalType.\"\"\"\n    cls._known_logical_types.add(logical_type_cls.urn(), logical_type_cls)\n    return logical_type_cls\n\n  @classmethod\n  def from_typing(cls, typ):\n    # type: (type) -> LogicalType\n\n    \"\"\"Construct an instance of a registered LogicalType implementation given a\n    typing.\n\n    Raises ValueError if no registered LogicalType implementation can encode the\n    given typing.\"\"\"\n\n    logical_type = cls._known_logical_types.get_logical_type_by_language_type(\n        typ)\n    if logical_type is None:\n      raise ValueError(\"No logical type registered for typing '%s'\" % typ)\n\n    return logical_type._from_typing(typ)\n\n  @classmethod\n  def _from_typing(cls, typ):\n    # type: (type) -> LogicalType\n\n    \"\"\"Construct an instance of this LogicalType implementation given a typing.\n    \"\"\"\n    raise NotImplementedError()\n\n  @classmethod\n  def from_runner_api(cls, logical_type_proto):\n    # type: (schema_pb2.LogicalType) -> LogicalType\n\n    \"\"\"Construct an instance of a registered LogicalType implementation given a\n    proto LogicalType.\n","sourceCodeStart":882,"sourceCodeEnd":918,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/typehints/schemas.py#L882-L918","documentation":"LogicalType.from_typing() looks up a registered LogicalType implementation that can encode the given Python typing. If none is registered it raises ValueError. Beam only converts typings to schema logical types for which a LogicalType subclass has been registered.","triggerScenarios":"Calling LogicalType.from_typing(SomeType) with a typing (e.g. a custom class, datetime with custom params) that no registered LogicalType's language_type() matches; using a logical type in a schema before its register_logical_type() call ran.","commonSituations":"Using a custom logical type whose registration module was never imported (side-effect registration missing); Beam version differences where a logical type (e.g. ParameterizedType, thift/decimal variants) is not registered by default.","solutions":["Import the module that registers the logical type (e.g. apache_beam.typehints.schemas) before conversion.","Implement and register a LogicalType subclass via LogicalType.register_logical_type(MyLogicalType) supporting the typing.","Fall back to a plain supported type (str/bytes/int) in the schema instead of the custom typing."],"exampleFix":"// before\nlt = LogicalType.from_typing(MyCustomType)  # ValueError\n\n// after\nLogicalType.register_logical_type(MyCustomLogicalType)  # registers language_type=MyCustomType\nlt = LogicalType.from_typing(MyCustomType)","handlingStrategy":"fallback","validationCode":"from apache_beam.typehints.schemas import LogicalType\n\ndef has_logical_type(typ):\n    return LogicalType._known_logical_types.get_logical_type_by_language_type(typ) is not None","typeGuard":null,"tryCatchPattern":"try:\n    lt = LogicalType.from_typing(typ)\nexcept ValueError:\n    lt = None  # use a supported plain type instead\nif lt is None:\n    typ = bytes  # fallback encoding","preventionTips":["Import all modules with register_logical_type() side effects at pipeline startup.","Pin your apache-beam version and check which logical types it registers by default.","Prefer standard supported typings in schema annotations."],"tags":["python","apache-beam","logical-type","registry","schema"],"backgroundTag":"resource-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}