Skip to content

Commit 855e7a5

Browse files
committed
Clean up unwanted changes
1 parent 7744013 commit 855e7a5

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

mleap-runtime/src/main/scala/ml/combust/mleap/runtime/transformer/feature/MultiInOutTransformer.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ package ml.combust.mleap.runtime.transformer.feature
33
import ml.combust.mleap.core.types._
44
import ml.combust.mleap.runtime.frame.Transformer
55

6+
/*
7+
This Transformer trait only used when the Spark Transformer has inputCol and inputCols
8+
, outputCol and outputCols. Because the saved shape will have port "input" instead of
9+
"input0", "output" instead "output0".
10+
*/
611
trait MultiInOutTransformer extends Transformer {
712
override def inputSchema: StructType = {
813
if (shape.getInput("input").isDefined) {

mleap-runtime/src/test/scala/ml/combust/mleap/runtime/transformer/feature/StringIndexerSpec.scala

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ class StringIndexerSpec extends org.scalatest.funspec.AnyFunSpec {
1414

1515
val stringIndexer = StringIndexer(
1616
shape = NodeShape.feature(
17-
inputPort="input0",
18-
outputPort="output0",
1917
inputCol = "test_string",
2018
outputCol = "test_index"),
2119
model = StringIndexerModel(Seq("index1", "index2", "index3")))
@@ -31,16 +29,12 @@ class StringIndexerSpec extends org.scalatest.funspec.AnyFunSpec {
3129
}
3230

3331
describe("with invalid input column") {
34-
val stringIndexer2 = stringIndexer.copy(shape = NodeShape.feature(
35-
inputPort="input0",
36-
outputPort="output0",
37-
inputCol = "bad_input",
38-
outputCol = "bad_output"))
32+
val stringIndexer2 = stringIndexer.copy(shape = NodeShape().withStandardInput("bad_input").
33+
withStandardOutput("output"))
3934

4035
it("returns a Failure") {
4136
assert(stringIndexer2.transform(frame).isFailure)
4237
}
43-
4438
}
4539

4640
describe("with invalid string") {

0 commit comments

Comments
 (0)