diff --git a/serde_arrow/src/internal/schema/from_type/mod.rs b/serde_arrow/src/internal/schema/from_type/mod.rs index 37949d2e..35075d38 100644 --- a/serde_arrow/src/internal/schema/from_type/mod.rs +++ b/serde_arrow/src/internal/schema/from_type/mod.rs @@ -69,7 +69,12 @@ impl Tracer { // check for known error messages of non self describing types fn is_non_self_describing_error(s: &str) -> bool { + // chrono::* s.contains("premature end of input") + // uuid::Uuid + || s.contains("UUID parsing failed") + // std::net::IpAddr + || s.contains("invalid IP address syntax") } struct TraceAny<'a>(&'a mut Tracer); diff --git a/serde_arrow/src/test/error_messages/trace_from_type.rs b/serde_arrow/src/test/error_messages/trace_from_type.rs index 7e19eb75..6b1c1e8c 100644 --- a/serde_arrow/src/test/error_messages/trace_from_type.rs +++ b/serde_arrow/src/test/error_messages/trace_from_type.rs @@ -42,6 +42,13 @@ fn chrono_types_are_not_self_describing() { assert_error_contains(&res, "non self describing type"); } +#[test] +fn net_ip_addr_is_not_self_describing() { + let res = SerdeArrowSchema::from_type::>(TracingOptions::default()); + assert_error_contains(&res, "path: \"$.item\""); + assert_error_contains(&res, "non self describing type"); +} + #[test] fn unsupported_recursive_types() { #[allow(unused)] diff --git a/serde_arrow/src/test_with_arrow/impls/issue_203_uuid.rs b/serde_arrow/src/test_with_arrow/impls/issue_203_uuid.rs index 945f0801..90fcc87b 100644 --- a/serde_arrow/src/test_with_arrow/impls/issue_203_uuid.rs +++ b/serde_arrow/src/test_with_arrow/impls/issue_203_uuid.rs @@ -31,4 +31,5 @@ fn example_as_list() { fn trace_from_type_does_not_work() { let res = SerdeArrowSchema::from_type::>(TracingOptions::default()); assert_error_contains(&res, "UUID parsing failed"); + assert_error_contains(&res, "non self describing type"); }