From 6ac91164988c31bdff2e023cdd8794e9e5ed8104 Mon Sep 17 00:00:00 2001 From: natalie <77713883+n-h-diaz@users.noreply.github.com> Date: Tue, 27 Aug 2024 20:07:22 -0700 Subject: [PATCH] Disable obs browser pages for some custom DCs (#4566) Updates * climate_trace * custom * feedingamerica * iitm * unsdg This is to remove dependency on BQ (and is currently broken for many instances currently), so we don't have to keep as many BQ versions Verified locally for each instance, but wanted to double check that this won't negatively impact any prod instance? --- run_server.sh | 1 + server/app_env/_base.py | 3 +++ server/app_env/autopush.py | 1 + server/app_env/dev.py | 1 + server/app_env/lite.py | 3 ++- server/app_env/local.py | 1 + server/app_env/production.py | 3 ++- server/app_env/staging.py | 1 + server/app_env/test.py | 3 ++- server/app_env/webdriver.py | 3 ++- server/templates/base.html | 1 + static/js/browser/observation_chart_section.tsx | 2 +- 12 files changed, 18 insertions(+), 5 deletions(-) diff --git a/run_server.sh b/run_server.sh index b5bc22f75f..544d17f5a2 100755 --- a/run_server.sh +++ b/run_server.sh @@ -59,6 +59,7 @@ while getopts ":e:p:m?d?l?xg" OPTION; do l) # Use local mixer export WEBSITE_MIXER_API_ROOT=http://127.0.0.1:8081 + ;; g) USE_GUNICORN=true ;; diff --git a/server/app_env/_base.py b/server/app_env/_base.py index 0fa20e3a2d..bf39efcf47 100644 --- a/server/app_env/_base.py +++ b/server/app_env/_base.py @@ -91,3 +91,6 @@ class Config: MIN_STAT_VAR_GEO_COVERAGE = 10 # NL Bad words file. BAD_WORDS_FILE = 'nl_bad_words.txt' + # Whether to enable BigQuery for instance. This is primarily used for + # accessing the observation browser pages. + ENABLE_BQ = False diff --git a/server/app_env/autopush.py b/server/app_env/autopush.py index 5d4fdbac46..ac25f61ca2 100644 --- a/server/app_env/autopush.py +++ b/server/app_env/autopush.py @@ -24,3 +24,4 @@ class Config(_base.Config): USE_LLM = True HIDE_DEBUG = False USE_MEMCACHE = False + ENABLE_BQ = True diff --git a/server/app_env/dev.py b/server/app_env/dev.py index 8c25bccf63..b0d6072ea5 100644 --- a/server/app_env/dev.py +++ b/server/app_env/dev.py @@ -23,3 +23,4 @@ class Config(_base.Config): USE_LLM = True HIDE_DEBUG = False USE_MEMCACHE = False + ENABLE_BQ = True diff --git a/server/app_env/lite.py b/server/app_env/lite.py index f636d1fdc1..fbd77128fe 100644 --- a/server/app_env/lite.py +++ b/server/app_env/lite.py @@ -17,4 +17,5 @@ class LocalConfig(local.Config): LITE = True - SHOW_DISASTER = False \ No newline at end of file + SHOW_DISASTER = False + ENABLE_BQ = True diff --git a/server/app_env/local.py b/server/app_env/local.py index c4527530b4..0f2ca34e09 100644 --- a/server/app_env/local.py +++ b/server/app_env/local.py @@ -20,6 +20,7 @@ class Config(_base.Config): API_ROOT = 'https://api.datacommons.org' SCHEME = 'http' USE_MEMCACHE = False + ENABLE_BQ = True class DCConfig(Config): diff --git a/server/app_env/production.py b/server/app_env/production.py index 0aee876dbc..68525ff541 100644 --- a/server/app_env/production.py +++ b/server/app_env/production.py @@ -18,4 +18,5 @@ class Config(_base.Config): GOOGLE_ANALYTICS_TAG_ID = 'G-KWSES5WXZE' USE_LLM = True - LOG_QUERY = True \ No newline at end of file + LOG_QUERY = True + ENABLE_BQ = True diff --git a/server/app_env/staging.py b/server/app_env/staging.py index ba623ae1ad..fa9912a184 100644 --- a/server/app_env/staging.py +++ b/server/app_env/staging.py @@ -19,3 +19,4 @@ class Config(_base.Config): GOOGLE_ANALYTICS_TAG_ID = 'G-HV2XYYS1JD' USE_LLM = True LOG_QUERY = True + ENABLE_BQ = True diff --git a/server/app_env/test.py b/server/app_env/test.py index f8623fe97f..b16b9eb9ca 100644 --- a/server/app_env/test.py +++ b/server/app_env/test.py @@ -19,4 +19,5 @@ class Config(_base.Config): TEST = True API_ROOT = 'api-root' SCHEME = 'http' - USE_MEMCACHE = False \ No newline at end of file + USE_MEMCACHE = False + ENABLE_BQ = True diff --git a/server/app_env/webdriver.py b/server/app_env/webdriver.py index 0750a21fe1..231dee6406 100644 --- a/server/app_env/webdriver.py +++ b/server/app_env/webdriver.py @@ -21,4 +21,5 @@ class Config(_base.Config): SECRET_PROJECT = 'datcom-website-dev' SCHEME = 'http' SHOW_TOPIC = True - USE_LLM = True \ No newline at end of file + USE_LLM = True + ENABLE_BQ = True diff --git a/server/templates/base.html b/server/templates/base.html index dad6572964..3595405925 100644 --- a/server/templates/base.html +++ b/server/templates/base.html @@ -72,6 +72,7 @@