Explorar o código

HUE-8679 [notebook] Order of ini properties is not properly loaded in global constant file

Just used the notebook flag for now
Romain Rigaux %!s(int64=7) %!d(string=hai) anos
pai
achega
b27dc3f8d6

+ 1 - 1
apps/jobbrowser/src/jobbrowser/api2.py

@@ -18,9 +18,9 @@
 import json
 import logging
 
-from django.utils.translation import ugettext as _
 from desktop.lib.i18n import smart_unicode
 from desktop.lib.django_util import JsonResponse
+from django.utils.translation import ugettext as _
 from desktop.views import serve_403_error
 
 from jobbrowser.apis.base_api import get_api

+ 3 - 1
desktop/core/src/desktop/templates/global_js_constants.mako

@@ -24,6 +24,7 @@
   from beeswax.conf import LIST_PARTITIONS_LIMIT
   from indexer.conf import ENABLE_NEW_INDEXER
   from metadata.conf import has_navigator, has_optimizer, has_workload_analytics, OPTIMIZER
+  from notebook.conf import ENABLE_QUERY_ANALYSIS
 %>
 
 (function () {
@@ -50,7 +51,8 @@
 
   window.HAS_OPTIMIZER = '${ has_optimizer() }' === 'True';
 
-  window.HAS_WORKLOAD_ANALYTICS = '${ has_workload_analytics() }' === 'True';
+  ## In the past was has_workload_analytics()
+  window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';
 
   window.HUE_CONTAINER = '${ IS_EMBEDDED.get() }' === 'True' ? '.hue-embedded-container' : 'body';
 

+ 2 - 1
desktop/libs/metadata/src/metadata/conf.py

@@ -58,7 +58,8 @@ def has_optimizer():
   return bool(OPTIMIZER.AUTH_KEY_ID.get())
 
 def has_workload_analytics():
-  return bool(ALTUS.AUTH_KEY_ID.get()) and ALTUS.HAS_WA.get() or ENABLE_QUERY_ANALYSIS.get()
+  # Note: unused
+  return bool(ALTUS.AUTH_KEY_ID.get()) and ALTUS.HAS_WA.get()
 
 
 def get_navigator_url():

+ 9 - 10
desktop/libs/notebook/src/notebook/conf.py

@@ -22,8 +22,7 @@ from django.utils.translation import ugettext_lazy as _t
 
 from desktop import appmanager
 from desktop.conf import is_oozie_enabled
-from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection,\
-  coerce_json_dict, coerce_bool, coerce_csv
+from desktop.lib.conf import Config, UnspecifiedConfigSection, ConfigSection, coerce_json_dict, coerce_bool, coerce_csv
 
 
 SHOW_NOTEBOOKS = Config(
@@ -116,7 +115,7 @@ INTERPRETERS_SHOWN_ON_WHEEL = Config(
 ENABLE_DBPROXY_SERVER = Config(
   key="enable_dbproxy_server",
   help=_t("Main flag to override the automatic starting of the DBProxy server."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
@@ -130,7 +129,7 @@ DBPROXY_EXTRA_CLASSPATH = Config(
 ENABLE_QUERY_BUILDER = Config(
   key="enable_query_builder",
   help=_t("Flag to enable the SQL query builder of the table assist."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
@@ -138,42 +137,42 @@ ENABLE_QUERY_BUILDER = Config(
 ENABLE_QUERY_SCHEDULING = Config(
   key="enable_query_scheduling",
   help=_t("Flag to enable the creation of a coordinator for the current SQL query."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_EXTERNAL_STATEMENT = Config(
   key="enable_external_statements",
   help=_t("Flag to enable the selection of queries from files, saved queries into the editor or as snippet."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
 ENABLE_BATCH_EXECUTE = Config(
   key="enable_batch_execute",
   help=_t("Flag to enable the bulk submission of queries as a background task through Oozie."),
-  type=bool,
+  type=coerce_bool,
   dynamic_default=is_oozie_enabled
 )
 
 ENABLE_SQL_INDEXER = Config(
   key="enable_sql_indexer",
   help=_t("Flag to turn on the SQL indexer."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )
 
 ENABLE_PRESENTATION = Config(
   key="enable_presentation",
   help=_t("Flag to turn on the Presentation mode of the editor."),
-  type=bool,
+  type=coerce_bool,
   default=True
 )
 
 ENABLE_QUERY_ANALYSIS = Config(
   key="enable_query_analysis",
   help=_t("Flag to turn on the built-in hints on Impala queries in the editor."),
-  type=bool,
+  type=coerce_bool,
   default=False
 )