File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed
main/scala/ml/combust/mleap/runtime/transformer/feature
test/scala/ml/combust/mleap/runtime/transformer/feature Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,11 @@ package ml.combust.mleap.runtime.transformer.feature
3
3
import ml .combust .mleap .core .types ._
4
4
import ml .combust .mleap .runtime .frame .Transformer
5
5
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
+ */
6
11
trait MultiInOutTransformer extends Transformer {
7
12
override def inputSchema : StructType = {
8
13
if (shape.getInput(" input" ).isDefined) {
Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ class StringIndexerSpec extends org.scalatest.funspec.AnyFunSpec {
14
14
15
15
val stringIndexer = StringIndexer (
16
16
shape = NodeShape .feature(
17
- inputPort= " input0" ,
18
- outputPort= " output0" ,
19
17
inputCol = " test_string" ,
20
18
outputCol = " test_index" ),
21
19
model = StringIndexerModel (Seq (" index1" , " index2" , " index3" )))
@@ -31,16 +29,12 @@ class StringIndexerSpec extends org.scalatest.funspec.AnyFunSpec {
31
29
}
32
30
33
31
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" ))
39
34
40
35
it(" returns a Failure" ) {
41
36
assert(stringIndexer2.transform(frame).isFailure)
42
37
}
43
-
44
38
}
45
39
46
40
describe(" with invalid string" ) {
You can’t perform that action at this time.
0 commit comments