Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
run: |
echo "VALIDATE_ALL_CODEBASE=false" >> $GITHUB_ENV
- name: Lint Code Base
uses: super-linter/super-linter/slim@v7
uses: super-linter/super-linter/slim@v8
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Use more complete checks for generated HTML linting
run: cp -f .github/linters/.htmlhintrc_morechecks .github/linters/.htmlhintrc
- name: Lint Generated HTML
uses: super-linter/super-linter/slim@v7
uses: super-linter/super-linter/slim@v8
env:
DEFAULT_BRANCH: main
FILTER_REGEX_INCLUDE: static/html/.*
Expand Down
3 changes: 1 addition & 2 deletions server/faq.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from collections import OrderedDict
import re
from collections import OrderedDict

ANCHOR_BIGQUERY = None

Expand All @@ -26,7 +26,6 @@ def load_faq():

# Finds the first anchor whose question contains a given string.
def find_anchor(query):
global anchors
questions = [question for question in anchors if query.lower() in question.lower()]
if len(questions):
return anchors.get(questions[0])
Expand Down
15 changes: 0 additions & 15 deletions server/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
from copy import deepcopy
from time import time


from . import dates as date_util


Expand All @@ -22,7 +21,6 @@ class VizTypes:


def update_reports():
global MAX_REPORT_STALENESS
global last_report_update

if (time() - last_report_update) < MAX_REPORT_STALENESS:
Expand All @@ -40,28 +38,24 @@ def update_reports():


def get_reports():
global reports_json
update_reports()

return list(map(get_report, reports_json.get("_reports")))


def get_featured_reports():
global reports_json
update_reports()

return map(get_report, reports_json.get("_featured"))


def map_reports(report_id): # pragma: no cover
global reports_json
report = reports_json.get(report_id)
report["id"] = report_id
return report


def get_report(report_id):
global reports_json
report = reports_json.get(report_id)
if not report:
return None
Expand All @@ -72,7 +66,6 @@ def get_report(report_id):


def get_metric(metric_id):
global reports_json
metrics = reports_json.get("_metrics")
metric = deepcopy(metrics.get(metric_id))
if not metric: # pragma: no cover
Expand All @@ -82,7 +75,6 @@ def get_metric(metric_id):


def get_similar_reports(metric_id, current_report_id):
global reports_json
similar_reports = {}
reports = reports_json.get("_reports", [])
for report_id in reports:
Expand All @@ -98,16 +90,10 @@ def get_similar_reports(metric_id, current_report_id):


def get_dates():
global report_dates
return report_dates


def get_latest_date(metric_id):
global report_dates
global latest_metric_dates
global latest_metric_check
global MAX_REPORT_STALENESS

# Check the cache before hitting GCS.
latest_date = latest_metric_dates.get(metric_id)
if latest_date: # pragma: no cover
Expand All @@ -128,7 +114,6 @@ def get_latest_date(metric_id):


def get_lenses():
global reports_json
# TODO: Consider sorting the lenses by name.
return reports_json.get("_lens", {})

Expand Down
1 change: 0 additions & 1 deletion server/techreport.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ def update_report():


def get_report():
global tech_report_json
update_report()

return tech_report_json
Expand Down
3 changes: 1 addition & 2 deletions server/timestamps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import json
import datetime
import json
import logging

timestamps_json = {}
Expand All @@ -13,7 +13,6 @@ def update_config():


def get_timestamps_config():
global timestamps_json
return timestamps_json


Expand Down
Loading