rdblue commented on code in PR #11919:
URL: https://github.com/apache/iceberg/pull/11919#discussion_r1907589600
##########
core/src/test/java/org/apache/iceberg/avro/AvroTestHelpers.java:
##########
@@ -126,9 +139,18 @@ private static void assertEquals(Type type, Object
expected, Object actual) {
assertThat(actual).as("Primitive value should be equal to
expected").isEqualTo(expected);
break;
case STRUCT:
- assertThat(expected).as("Expected should be a
Record").isInstanceOf(Record.class);
- assertThat(actual).as("Actual should be a
Record").isInstanceOf(Record.class);
- assertEquals(type.asStructType(), (Record) expected, (Record) actual);
+ assertThat(expected)
+ .as("Expected should be a Record or StructLike")
+ .isInstanceOfAny(Record.class, StructLike.class);
+
+ if (expected instanceof Record) {
+ assertThat(actual).as("Actual should be a
Record").isInstanceOf(Record.class);
+ assertEquals(type.asStructType(), (Record) expected, (Record)
actual);
+ } else {
+ assertThat(actual).as("Actual should be a
GenericRecord").isInstanceOf(StructLike.class);
Review Comment:
The message doesn't match the assertion. I think this should be `"Actual
should be a StructLike"`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]