-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoSuchMethodError: org.scalatest.Assertions.assertionsHelper #315
Comments
What version of ScalaTest are you using? I had the same issue and changing to the version used in this lib i.e. to 3.0.5 solved the issue. |
Confirmed, referencing scalatest 3.0.5 helped!
|
I also ran into this issue when using latest scalatest ( "org.scalatest" %% "scalatest" % "3.2.3"). The highest version I have tested as working is 3.0.9. 3.1.x already fails. |
It seems to be an issue with the way assertions are written in TestSuite.scala, around the use of I've worked around this by 'forking' the function and replacing the use of these assertions with direct ones like // return typed changed from `Unit` to `Assertion`
def assertDataFrameApproximateEqualsPatched(
expected: DataFrame, result: DataFrame, tol: Double): Assertion = {
// was: assert(expected.schema, result.schema)
assert(expected.schema === result.schema)
// in-lined from https://github.com/holdenk/spark-testing-base/blob/0ffd8e208db7b438d11960109ae77ebf5688c06f/core/src/main/2.0/scala/com/holdenkarau/spark/testing/DataFrameSuiteBase.scala#L207
def zipWithIndex[U](rdd: RDD[U]) = {
rdd.zipWithIndex().map { case (row, idx) => (idx, row) }
}
try {
expected.rdd.cache
result.rdd.cache
// was: assert("Length not Equal", expected.rdd.count, result.rdd.count)
assert(expected.rdd.count === result.rdd.count, "Length not Equal")
val expectedIndexValue = zipWithIndex(expected.rdd)
val resultIndexValue = zipWithIndex(result.rdd)
val unequalRDD = expectedIndexValue.join(resultIndexValue).filter { case (idx, (r1, r2)) =>
!(r1.equals(r2) || DataFrameSuiteBase.approxEquals(r1, r2, tol))
}
// was: assertEmpty(unequalRDD.take(maxUnequalRowsToShow))
assert(unequalRDD.take(maxUnequalRowsToShow).isEmpty)
} finally {
expected.rdd.unpersist()
result.rdd.unpersist()
}
} So, basically just not using the |
I am getting this error : "NoSuchMethodError: org.scalatest.Assertions.assertionsHelper" when calling "assertDataFrameApproximateEquals"
throws error:
The text was updated successfully, but these errors were encountered: