Skip to content

Commit 073651f

Browse files
committed
reverting to assert
1 parent bfa853a commit 073651f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

doctor_visits/delphi_doctor_visits/process_data.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,17 @@ def format_df(df: pd.DataFrame, geo_id: str, se: bool, logger):
5454

5555
val_isnull = df["val"].isnull()
5656
df_val_null = df[val_isnull]
57-
if not df_val_null.empty:
58-
logger.info("sensor value is nan, check pipeline")
57+
assert len(df_val_null) == 0, "sensor value is nan, check pipeline"
5958
df = df[~val_isnull]
6059

6160
se_too_high = df["se"] >= 5
6261
df_se_too_high = df[se_too_high]
63-
if len(df_se_too_high) > 0:
64-
logger.info(f"standard error suspiciously high! investigate {geo_id}")
62+
assert len(df_se_too_high) == 0, f"standard error suspiciously high! investigate {geo_id}"
6563
df = df[~se_too_high]
6664

6765
sensor_too_high = df["val"] >= 90
6866
df_sensor_too_high = df[sensor_too_high]
69-
if len(df_sensor_too_high) > 0:
70-
logger.info(f"standard error suspiciously high! investigate {geo_id}")
67+
assert len(df_sensor_too_high) == 0, f"standard error suspiciously high! investigate {geo_id}"
7168
df = df[~sensor_too_high]
7269

7370
if se:

0 commit comments

Comments
 (0)