mickjermsurawong-stripe commented on a change in pull request #25736: 
[SPARK-29026][SQL] Improve error message in `schemaFor` in trait without 
companion object constructor
URL: https://github.com/apache/spark/pull/25736#discussion_r322520234
 
 

 ##########
 File path: 
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/ScalaReflectionSuite.scala
 ##########
 @@ -404,6 +407,13 @@ class ScalaReflectionSuite extends SparkFunSuite {
         StructField("x", IntegerType, nullable = false))), nullable = true))
   }
 
+  test("SPARK-29026: schemaFor for trait without companion constructor throws 
exception ") {
+    val e = intercept[UnsupportedOperationException] {
+      schemaFor[TraitProductWithoutCompanion]
+    }
+    e.getMessage.contains("Unable to find constructor")
+  }
 
 Review comment:
   ^ Scrolling up, an existing test is for `ScroogeLikeExample` where it checks 
that trait with companion object constructor works.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to