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: 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

Reply via email to