From 99d1e9b790609455d5287d48813329c78406b3f5 Mon Sep 17 00:00:00 2001 From: Michael Duong Date: Tue, 5 Dec 2023 13:43:40 +0000 Subject: [PATCH] add basic check --- etl/epc/property_change_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/etl/epc/property_change_app.py b/etl/epc/property_change_app.py index a792ae4a..36eb31b6 100644 --- a/etl/epc/property_change_app.py +++ b/etl/epc/property_change_app.py @@ -472,7 +472,9 @@ class EPCRecord: """ Validate a string field """ - + if not isinstance(field_value, str): + raise ValueError(f"Field {record_key} has value {field_value} which is not a string") + if 'function' in validation_config: try: validation_config['function'](field_value) @@ -487,6 +489,8 @@ class EPCRecord: """ Validate a float field """ + if not isinstance(field_value, float): + raise ValueError(f"Field {record_key} has value {field_value} which is not a float") if 'function' in validation_config: try: