rdblue commented on code in PR #11831: URL: https://github.com/apache/iceberg/pull/11831#discussion_r1953616108
########## api/src/test/java/org/apache/iceberg/types/TestTypes.java: ########## @@ -43,6 +67,13 @@ public void fromPrimitiveString() { assertThat(Types.fromPrimitiveString("Decimal(2,3)")).isEqualTo(Types.DecimalType.of(2, 3)); + assertThatExceptionOfType(IllegalArgumentException.class) + .isThrownBy(() -> Types.fromPrimitiveString("variant")) + .withMessage("Cannot parse type string to primitive: variant"); Review Comment: I think this message could be confusing. When this happens, we know that the type name is valid. The problem is that it can't be returned as a `PrimitiveType`. I would prefer to say that in the error: `"Cannot parse type string: variant is not a primitive type"`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org