Skip to content

Commit

Permalink
[SW-1623] Fix tests causing intermittent NPE in PySparkling with roll…
Browse files Browse the repository at this point in the history
…ups on external backend (#1534)

(cherry picked from commit f7e5031)
  • Loading branch information
jakubhava committed Sep 18, 2019
1 parent 0700c45 commit dce70c0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion examples/scripts/hamOrSpam.script.scala
Expand Up @@ -141,7 +141,9 @@ def isSpam(msg: String,
hashingTF.transform (
tokenize (msgRdd))).map(v => ("?", v)).toDF("target", "fv")
val msgTable: H2OFrame = h2oContext.asH2OFrame(msgVector)
msgTable.remove(0) // remove first column
H2OFrameSupport.withLockAndUpdate(msgTable) {
_.remove(0) // remove first column
}
val prediction = dlModel.score(msgTable)
//println(prediction)
prediction.vecs()(1).at(0) < hamThreshold
Expand Down
Expand Up @@ -180,7 +180,9 @@ object HamOrSpamDemo extends SparkContextSupport with ModelMetricsSupport with H
hashingTF.transform(
tokenize(msgRdd))).map(v => SMS("?", v)).toDF
val msgTable: H2OFrame = msgVector
msgTable.remove(0) // remove first column
H2OFrameSupport.withLockAndUpdate(msgTable) {
_.remove(0) // remove first column
}
val prediction = dlModel.score(msgTable)
//println(prediction)
prediction.vecs()(1).at(0) < hamThreshold
Expand Down

0 comments on commit dce70c0

Please sign in to comment.