def __init__(self, bound_app, graph, *args, **kwargs): self._bound_app = bound_app self._graph = graph self._session = self._bound_app.session # add op to dag self._op = run_app(self._bound_app, *args, **kwargs) self._session.dag.add_op(self._op)
def _query(self, *args, **kwargs): """Create a `RUN_APP` Operation, and send it to analytical engine to do actual query. Then retrieve query contexts and return. """ self._check_unmodified() op = run_app(self._graph, self, *args, **kwargs) ret = op.eval() ret = json.loads(ret) context_key, context_type = ret["context_key"], ret["context_type"] results = create_context(context_type, self._session_id, context_key, self._graph) return results