From 91a3772b679034b5427c4471810b67389159a121 Mon Sep 17 00:00:00 2001 From: Gertjan van den Burg Date: Thu, 5 Sep 2019 16:21:10 +0100 Subject: Add check for use of null in datasets --- app/utils/datasets.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/utils/datasets.py b/app/utils/datasets.py index 6b5805f..4341467 100644 --- a/app/utils/datasets.py +++ b/app/utils/datasets.py @@ -62,10 +62,14 @@ def validate_dataset(filename): if "time" in data.keys(): if len(data["time"]["raw"]) != data["n_obs"]: return "Number of time points doesn't match number of observations" + if None in data["time"]["raw"]: + return "Null is not supported in time axis. Use 'NaN' instead." for var in data["series"]: if len(var["raw"]) != data["n_obs"]: return "Number of observations doesn't match for %s" % var["label"] + if None in var["raw"]: + return "Null is not supported in series. Use 'NaN' instead." return None -- cgit v1.2.3