mirror of
https://github.com/apache/zeppelin
synced 2026-05-24 09:38:26 +00:00
Remove %dep interpreter deprecated message
This commit is contained in:
parent
e0930570df
commit
e3ae4c8554
3 changed files with 11 additions and 10 deletions
|
|
@ -228,8 +228,7 @@ Here are few examples:
|
|||
```
|
||||
|
||||
### 3. Dynamic Dependency Loading via %spark.dep interpreter
|
||||
> Note: `%spark.dep` interpreter is deprecated since v0.6.0.
|
||||
`%spark.dep` interpreter loads libraries to `%spark` and `%spark.pyspark` but not to `%spark.sql` interpreter. So we recommend you to use the first option instead.
|
||||
> Note: `%spark.dep` interpreter loads libraries to `%spark` and `%spark.pyspark` but not to `%spark.sql` interpreter. So we recommend you to use the first option instead.
|
||||
|
||||
When your code requires external library, instead of doing download/copy/restart Zeppelin, you can easily do following jobs using `%spark.dep` interpreter.
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ import org.sonatype.aether.util.artifact.JavaScopes;
|
|||
import org.sonatype.aether.util.filter.DependencyFilterUtils;
|
||||
import org.sonatype.aether.util.filter.PatternExclusionsDependencyFilter;
|
||||
|
||||
import scala.Console;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -66,8 +64,6 @@ public class SparkDependencyContext {
|
|||
}
|
||||
|
||||
public Dependency load(String lib) {
|
||||
Console.println("DepInterpreter(%dep) deprecated. "
|
||||
+ "Load dependency through GUI interpreter menu instead.");
|
||||
Dependency dep = new Dependency(lib);
|
||||
|
||||
if (dependencies.contains(dep)) {
|
||||
|
|
@ -78,16 +74,12 @@ public class SparkDependencyContext {
|
|||
}
|
||||
|
||||
public Repository addRepo(String name) {
|
||||
Console.println("DepInterpreter(%dep) deprecated. "
|
||||
+ "Add repository through GUI interpreter menu instead.");
|
||||
Repository rep = new Repository(name);
|
||||
repositories.add(rep);
|
||||
return rep;
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
Console.println("DepInterpreter(%dep) deprecated. "
|
||||
+ "Remove dependencies and repositories through GUI interpreter menu instead.");
|
||||
dependencies = new LinkedList<>();
|
||||
repositories = new LinkedList<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -231,6 +231,16 @@ public class SparkInterpreterTest {
|
|||
assertEquals(Code.ERROR, result.code());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testZContextDependencyLoading() {
|
||||
// try to import library does not exist on classpath. it'll fail
|
||||
assertEquals(InterpreterResult.Code.ERROR, repl.interpret("import org.apache.commons.csv.CSVFormat", context).code());
|
||||
|
||||
// load library from maven repository and try to import again
|
||||
repl.interpret("z.load(\"org.apache.commons:commons-csv:1.1\")", context);
|
||||
assertEquals(InterpreterResult.Code.SUCCESS, repl.interpret("import org.apache.commons.csv.CSVFormat", context).code());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyConfigurationVariablesOnlyForNonSparkProperties() {
|
||||
Properties intpProperty = repl.getProperty();
|
||||
|
|
|
|||
Loading…
Reference in a new issue