From c5244470ed250a1b92d55591c3a1c39e5c8535ed Mon Sep 17 00:00:00 2001 From: Emma Nechamkin Date: Thu, 25 Aug 2022 18:38:22 -0400 Subject: [PATCH] updated with error messages --- .../data_pipeline/etl/sources/national_risk_index/etl.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/data/data-pipeline/data_pipeline/etl/sources/national_risk_index/etl.py b/data/data-pipeline/data_pipeline/etl/sources/national_risk_index/etl.py index d1373602..51ffcfa0 100644 --- a/data/data-pipeline/data_pipeline/etl/sources/national_risk_index/etl.py +++ b/data/data-pipeline/data_pipeline/etl/sources/national_risk_index/etl.py @@ -164,7 +164,12 @@ class NationalRiskIndexETL(ExtractTransformLoad): != base_expectation ][self.AGRICULTURAL_VALUE_INPUT_FIELD_NAME].max() < self.AGRIVALUE_LOWER_BOUND - ) + ), "Clipping the agrivalue did not work!" + + assert ( + df_nri[self.EXPECTED_AGRICULTURE_LOSS_RATE_FIELD_NAME] + != base_expectation + ).sum() > 0, "Clipping the agrivalue did nothing!" # This produces a boolean that is True in the case of non-zero agricultural value df_nri[self.CONTAINS_AGRIVALUE] = (