Skip to content

Commit

Permalink
Disable obs browser pages for some custom DCs (#4566)
Browse files Browse the repository at this point in the history
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?
  • Loading branch information
n-h-diaz authored Aug 28, 2024
1 parent 7007e9d commit 6ac9116
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions run_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
;;
Expand Down
3 changes: 3 additions & 0 deletions server/app_env/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions server/app_env/autopush.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ class Config(_base.Config):
USE_LLM = True
HIDE_DEBUG = False
USE_MEMCACHE = False
ENABLE_BQ = True
1 change: 1 addition & 0 deletions server/app_env/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ class Config(_base.Config):
USE_LLM = True
HIDE_DEBUG = False
USE_MEMCACHE = False
ENABLE_BQ = True
3 changes: 2 additions & 1 deletion server/app_env/lite.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@

class LocalConfig(local.Config):
LITE = True
SHOW_DISASTER = False
SHOW_DISASTER = False
ENABLE_BQ = True
1 change: 1 addition & 0 deletions server/app_env/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion server/app_env/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
class Config(_base.Config):
GOOGLE_ANALYTICS_TAG_ID = 'G-KWSES5WXZE'
USE_LLM = True
LOG_QUERY = True
LOG_QUERY = True
ENABLE_BQ = True
1 change: 1 addition & 0 deletions server/app_env/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ class Config(_base.Config):
GOOGLE_ANALYTICS_TAG_ID = 'G-HV2XYYS1JD'
USE_LLM = True
LOG_QUERY = True
ENABLE_BQ = True
3 changes: 2 additions & 1 deletion server/app_env/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ class Config(_base.Config):
TEST = True
API_ROOT = 'api-root'
SCHEME = 'http'
USE_MEMCACHE = False
USE_MEMCACHE = False
ENABLE_BQ = True
3 changes: 2 additions & 1 deletion server/app_env/webdriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ class Config(_base.Config):
SECRET_PROJECT = 'datcom-website-dev'
SCHEME = 'http'
SHOW_TOPIC = True
USE_LLM = True
USE_LLM = True
ENABLE_BQ = True
1 change: 1 addition & 0 deletions server/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<script>
globalThis.isCustomDC = {{ config['CUSTOM']|int }};
globalThis.STAT_VAR_HIERARCHY_CONFIG = {{ config['STAT_VAR_HIERARCHY_CONFIG'] | tojson }};
globalThis.enableBQ = {{ config['ENABLE_BQ']|int }};
</script>
<script>
// This script is to allow embedding the website as an iframe and allow the
Expand Down
2 changes: 1 addition & 1 deletion static/js/browser/observation_chart_section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class ObservationChartSection extends React.Component<
idx={index}
statVarId={this.props.statVarId}
placeDcid={this.props.placeDcid}
canClickObs={!globalThis.isCustomDC}
canClickObs={globalThis.enableBQ}
statVarName={this.props.statVarName}
/>
<p className="metadata">provenance: {metadata.provenanceUrl}</p>
Expand Down

0 comments on commit 6ac9116

Please sign in to comment.