From 7ed0488fcbd79dea18f808dbae9c443afae2bef6 Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Sun, 7 Jan 2024 18:39:21 -0600 Subject: [PATCH] added exception to undefined type --- src/pydantic_avro/base.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pydantic_avro/base.py b/src/pydantic_avro/base.py index 6e16a30..a652a91 100644 --- a/src/pydantic_avro/base.py +++ b/src/pydantic_avro/base.py @@ -151,6 +151,9 @@ def get_type(value: dict) -> dict: value_type = value_type.get("type") avro_type_dict["type"] = {"type": "map", "values": value_type} else: + if t is None: + raise ValueError(f"Field '{value}' does not have a defined type.") + raise NotImplementedError( f"Type '{t}' not support yet, " f"please report this at https://github.com/godatadriven/pydantic-avro/issues"