File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
src/test/java/org/apache/sysds/test/functions/mlcontext Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ jobs:
118118 black \
119119 opt-einsum \
120120 nltk
121-
121+
122122 - name : Build Python Package
123123 run : |
124124 cd src/main/python
Original file line number Diff line number Diff line change 5757import org .apache .spark .sql .types .DoubleType ;
5858import org .apache .spark .sql .types .StructField ;
5959import org .apache .spark .sql .types .StructType ;
60+ import org .apache .sysds .api .mlcontext .MLContext ;
6061import org .apache .sysds .api .mlcontext .MLContextConversionUtil ;
6162import org .apache .sysds .api .mlcontext .MLContextException ;
6263import org .apache .sysds .api .mlcontext .MLContextUtil ;
@@ -1964,4 +1965,28 @@ public void testNNImport() {
19641965 .getScalarObject ("R" ).getDoubleValue ();
19651966 Assert .assertEquals (1000 , ret , 1e-20 );
19661967 }
1968+
1969+ @ Test
1970+ public void testMLContextExecuteWithExplainType () {
1971+ LOG .debug ("MLContextTest - test getter / setter" );
1972+ ml .setExplain (true );
1973+ String s = "print(\" Hello World!\" )" ;
1974+ for (MLContext .ExplainLevel el : MLContext .ExplainLevel .values ()) {
1975+ ml .setExplainLevel (el );
1976+ String out = executeAndCaptureStdOut (dml (s )).getRight ();
1977+ String [] lines = out .split ("\n " );
1978+ Assert .assertTrue (lines [0 ].contains (el .getExplainType ().toString ()));
1979+ }
1980+ }
1981+
1982+ @ Test
1983+ public void testMLContextExecuteWithExecutionType () {
1984+ LOG .debug ("MLContextTest - test getter / setter" );
1985+ ml .setExplain (false );
1986+ String s = "print(\" Hello World!\" )" ;
1987+ for (MLContext .ExecutionType et : MLContext .ExecutionType .values ()) {
1988+ ml .setExecutionType (et );
1989+ ml .execute (dml (s ));
1990+ }
1991+ }
19671992}
You can’t perform that action at this time.
0 commit comments