Github user c-horn commented on a diff in the pull request:
https://github.com/apache/spark/pull/21752#discussion_r202445344
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/DataFrameAggregateSuite.scala ---
@@ -717,4 +717,9 @@ class DataFrameAggregateSuite extends QueryTest with
SharedSQLContext {
Row(1, 2, 1) :: Row(2, 2, 2) :: Row(3, 2, 3) :: Nil)
}
+ test("SPARK-24788: RelationalGroupedDataset.toString " +
+ "with unresolved grouping expressions should not throw an exception") {
+ noException should be thrownBy testData.groupBy('key).toString
--- End diff --
The assertion is a negative statement about the raising of exceptions; I do
not wish to enforce a particular `toString` format for this type going forward.
Is there a specific guideline for test code format and tooling? The
Matchers `noException` word is the only way I know of to test for exceptions in
scalatest.
I will try to find a more concise way of expressing the test, or maybe it
can simply be left as `testData.groupBy('key).toString` with a comment
indicating that it should not throw errors.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]