Skip to content

Commit

Permalink
frontend update to send the session_type from the session returned by…
Browse files Browse the repository at this point in the history
… previous call.

Change-Id: Ice8f9a48344a8b6008d0c0e632ddc20948034da5
  • Loading branch information
amitsrivastava committed Oct 24, 2023
1 parent ad854bb commit b3e56bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions desktop/core/src/desktop/js/apps/notebook/snippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1878,7 +1878,7 @@ class Snippet {
if (!notebook.sessions().length) {
notebook.addSession(
new Session(vm, {
type: self.type(),
type: data.handle.session_type || self.type(),
session_id: data.handle.session_guid,
id: data.handle.session_id,
properties: {}
Expand All @@ -1887,7 +1887,7 @@ class Snippet {
} else {
notebook.sessions()[0].session_id(data.handle.session_guid);
notebook.sessions()[0].id(data.handle.session_id);
notebook.sessions()[0].type(self.type());
notebook.sessions()[0].type(data.handle.session_type || self.type());
}
}
if (vm.editorMode()) {
Expand Down
4 changes: 2 additions & 2 deletions desktop/libs/notebook/src/notebook/connectors/hiveserver2.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,8 @@ def execute(self, notebook, snippet):
db = self._get_db(snippet, interpreter=self.interpreter)

statement = self._get_current_statement(notebook, snippet)
compute = snippet.get('compute')
session_type = compute['name'] if is_compute(snippet) else snippet['type']
compute = snippet.get('compute', {})
session_type = compute['name'] if is_compute(snippet) and compute.get('name') else snippet['type']
session = self._get_session(notebook, session_type)

query = self._prepare_hql_query(snippet, statement['statement'], session)
Expand Down

0 comments on commit b3e56bd

Please sign in to comment.