replace name zeppelin context on python

This commit is contained in:
CloverHearts 2017-03-31 03:46:08 +09:00
parent 9fbf70d667
commit b6b804ad97
3 changed files with 5 additions and 5 deletions

View file

@ -222,7 +222,7 @@ public class PythonInterpreter extends Interpreter implements ExecuteResultHandl
// Add matplotlib display hook
InterpreterGroup intpGroup = getInterpreterGroup();
if (intpGroup != null && intpGroup.getInterpreterHookRegistry() != null) {
registerHook(HookType.POST_EXEC_DEV, "z._displayhook()");
registerHook(HookType.POST_EXEC_DEV, "_zc._displayhook()");
}
// Add matplotlib display hook
try {

View file

@ -87,7 +87,7 @@ public class PythonInterpreterPandasSql extends Interpreter {
LOG.info("Running SQL query: '{}' over Pandas DataFrame", st);
Interpreter python = getPythonInterpreter();
return python.interpret("z.show(pysqldf('" + st + "'))\nz._displayhook()", context);
return python.interpret("_zc.show(pysqldf('" + st + "'))\n_zc._displayhook()", context);
}
@Override

View file

@ -204,8 +204,8 @@ intp = gateway.entry_point
intp.onPythonScriptInitialized(os.getpid())
java_import(gateway.jvm, "org.apache.zeppelin.display.Input")
z = PyZeppelinContext(intp)
z._setup_matplotlib()
z = _zc = PyZeppelinContext(intp)
_zc._setup_matplotlib()
output = Logger()
sys.stdout = output
@ -227,7 +227,7 @@ while True :
global_hook = None
try:
user_hook = z.getHook('post_exec')
user_hook = _zc.getHook('post_exec')
except:
user_hook = None