Copilot commented on code in PR #6808:
URL: https://github.com/apache/texera/pull/6808#discussion_r3634622199


##########
common/workflow-operator/src/test/scala/org/apache/texera/amber/operator/LogicalOpSpec.scala:
##########
@@ -71,4 +71,18 @@ class LogicalOpSpec extends AnyFlatSpec {
     }
     assert(ex.getMessage == "operator DistinctOpDesc does not support 
reconfiguration")
   }
+
+  "LogicalOp @JsonSubTypes" should "register each operator subtype exactly 
once" in {
+    // SklearnLogisticRegression / ...CV were each listed twice, so consumers
+    // enumerating the registry saw them twice.
+    val types = classOf[LogicalOp]
+      .getAnnotation(classOf[com.fasterxml.jackson.annotation.JsonSubTypes])
+      .value()

Review Comment:
   `getAnnotation(...)` returns `null` when the annotation is missing; calling 
`.value()` directly would then throw an NPE, producing a less-informative test 
failure. Add an explicit assertion on the annotation presence before 
dereferencing it so failures clearly explain what’s wrong.



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

Reply via email to