fix dockerfile in dev and remove chart rendering if data query is empty

This commit is contained in:
sadnub 2023-10-04 11:01:28 -04:00
parent 9d07131fd6
commit 4747ffc08b
2 changed files with 15 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# pulls community scripts from git repo
FROM python:3.11.4-slim AS GET_SCRIPTS_STAGE
RUN apt-get update &&
apt-get install -y --no-install-recommends git &&
git clone https://github.com/amidaware/community-scripts.git /community-scripts
RUN apt-get update && \
apt-get install -y --no-install-recommends git && \
git clone https://github.com/amidaware/community-scripts.git /community-scripts
FROM python:3.11.4-slim
@ -20,8 +20,8 @@ EXPOSE 8000 8383 8005
RUN apt-get update && \
apt-get install -y build-essential weasyprint
RUN groupadd -g 1000 tactical &&
useradd -u 1000 -g 1000 tactical
RUN groupadd -g 1000 tactical && \
useradd -u 1000 -g 1000 tactical
# copy community scripts
COPY --from=GET_SCRIPTS_STAGE /community-scripts /community-scripts

View File

@ -526,6 +526,9 @@ def process_chart_variables(*, variables: Dict[str, Any]) -> Dict[str, Any]:
if not isinstance(charts, dict):
return variables
# these will be remove so they don't render in the template
invalid_chart_keys = []
for key, chart in charts.items():
options = chart.get("options")
if not isinstance(options, dict):
@ -546,6 +549,10 @@ def process_chart_variables(*, variables: Dict[str, Any]) -> Dict[str, Any]:
if not path_exists:
continue
if not data:
invalid_chart_keys.append(key)
continue
options["data_frame"] = data
traces = chart.get("traces")
@ -558,6 +565,9 @@ def process_chart_variables(*, variables: Dict[str, Any]) -> Dict[str, Any]:
layout=layout,
)
for key in invalid_chart_keys:
del charts[key]
return variables