From cdf7d428eddd1fa0b606638e609a7e0aed8f4beb Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 8 Jul 2019 16:02:45 -0700 Subject: [PATCH 1/2] Try to fix the failing test --- .../op/stages/base/sequence/SequenceEstimatorTest.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala b/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala index 427fb8f55a..bc986f43ef 100644 --- a/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala +++ b/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala @@ -73,14 +73,14 @@ class FractionOfResponsesEstimator(uid: String = UID[FractionOfResponsesEstimato import dataset.sparkSession.implicits._ val sizes = dataset.map(_.map(_.size)) val size = getInputFeatures().length - val counts = sizes.select(SequenceAggregators.SumNumSeq[Int](size = size).toColumn).first() + val counts = sizes.select(SequenceAggregators.SumNumSeq[Int](size = size).toColumn).first().toList new FractionOfResponsesModel(counts = counts, operationName = operationName, uid = uid) } } final class FractionOfResponsesModel private[op] ( - val counts: Seq[Int], + val counts: List[Int], operationName: String, uid: String ) extends SequenceModel[DateList, OPVector](operationName = operationName, uid = uid) { From fc67bd1862162edb4ee87cc87861a8ece4f26daf Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 8 Jul 2019 16:40:48 -0700 Subject: [PATCH 2/2] use seq of double values --- .../op/stages/base/sequence/SequenceEstimatorTest.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala b/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala index bc986f43ef..bfb926dcd8 100644 --- a/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala +++ b/features/src/test/scala/com/salesforce/op/stages/base/sequence/SequenceEstimatorTest.scala @@ -73,14 +73,14 @@ class FractionOfResponsesEstimator(uid: String = UID[FractionOfResponsesEstimato import dataset.sparkSession.implicits._ val sizes = dataset.map(_.map(_.size)) val size = getInputFeatures().length - val counts = sizes.select(SequenceAggregators.SumNumSeq[Int](size = size).toColumn).first().toList + val counts = sizes.select(SequenceAggregators.SumNumSeq[Int](size = size).toColumn).first().map(_.toDouble) new FractionOfResponsesModel(counts = counts, operationName = operationName, uid = uid) } } final class FractionOfResponsesModel private[op] ( - val counts: List[Int], + val counts: Seq[Double], operationName: String, uid: String ) extends SequenceModel[DateList, OPVector](operationName = operationName, uid = uid) {