HUE-9100 [editor] Delay execute until session create is completed

Review Request #14618 — Created Dec. 12, 2019 and submitted

jgauthier
hue
master
hue
jgauthier, johan, ranade, romain, weixia, yingc

commit ed733a8b428b1562d289f3af922fc1fae7d4b2d4
Author: Jean-Francois Desjeans Gauthier <jf.desjeans.gauthier@gmail.com>
Date: Wed Dec 11 13:52:17 2019 -0800

HUE-9100 \[editor\] Delay execute until session create is completed

https://github.com/cloudera/hue/commit/f29efd07cb5ddd4571bfc9bec0e5bf7ecc518d22, https://review.cloudera.org/r/5715/ had introduced a delay in createSession in order to have syntax appear highlighting faster. Many changes have happen since and it's no longer an issue. Snippet.init() potentially calls execute if a statement is available and we wait until createSession is completed, before calling init(). This change is not needed in notebook 2, because execution requires a session. In notebook 1, execution is not dependent on getting a session first.

:100644 100644 cbf0f6e704... 16792078c9... M desktop/core/src/desktop/js/apps/notebook/snippet.js



  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
romain
  1. Some thoughts just in case it could be simplified without spending too much time

  2. There is no way to disable execute() instead? (it is done already when editor is empty and more IIRC)

    When would this happen?

    (and could do something similar to self.isCanceling() if still not sure maybe. Historycally, in the Spark Notebook, doing execute on a snippet that did not have a session would trigger the create session an then the create session would automatically execute the statement, maybe it is simpler this way?)

    1. This happens when you open a notebook with a statement inside. Example I've been using is go to table browser page and press query button.

  3. 
      
jgauthier
romain
  1. Thanks for all the explanations!

  2. 
      
jgauthier
Review request changed

Status: Closed (submitted)

Loading...