diff --git a/ioos_metrics/ioos_metrics.py b/ioos_metrics/ioos_metrics.py index 69e93bd..71c53d7 100644 --- a/ioos_metrics/ioos_metrics.py +++ b/ioos_metrics/ioos_metrics.py @@ -57,6 +57,8 @@ def _compare_metrics(column, num): Compares last stored metric against the new one and report if it is up, down, or the same. """ + if num is None: + return f"[{date}] : {column} failed." last_row = previous_metrics().iloc[-1] date = last_row["date_UTC"] old = last_row[column] @@ -212,7 +214,8 @@ def atn_deployments(): headers = {"Accept": "application/json"} raw_payload = requests.get( - "https://search.axds.co/v2/search?portalId=99", headers=headers + "https://search.axds.co/v2/search?portalId=99", + headers=headers, ) json_payload = raw_payload.json() for plt in json_payload["types"]: @@ -296,7 +299,9 @@ def ioos_core_variables(): # Drop the rows where 'name' doesn't exist. df = df.dropna( - axis="index", how="any", subset="http://mmisw.org/ont/ioos/core_variable/name" + axis="index", + how="any", + subset="http://mmisw.org/ont/ioos/core_variable/name", ) return len(df.index.tolist())