With PR #173 when calling validation_errors = portfolio_exposure.check() the 'Class of business' is checked (feature for cyber model)
If not detected this will always raise an OedException which ignores any validation config options given
|
DEFAULT_VALIDATION_CONFIG = [ |
|
{'name': 'source_coherence', 'on_error': 'log'}, |
|
{'name': 'required_fields', 'on_error': 'raise'}, |
|
{'name': 'unknown_column', 'on_error': 'raise'}, |
|
{'name': 'valid_values', 'on_error': 'raise'}, |
|
{'name': 'perils', 'on_error': 'raise'}, |
|
{'name': 'occupancy_code', 'on_error': 'raise'}, |
|
{'name': 'construction_code', 'on_error': 'raise'}, |
|
{'name': 'country_and_area_code', 'on_error': 'raise'}, |
|
{'name': 'conditional_requirement', 'on_error': 'raise'}, |
|
] |
From:
|
elif len(final_cobs) == 0: |
|
error_msg = "\n".join(f"{class_of_business}:" |
|
+ ("\n " + ", ".join(messages['missing']) + " missing" if messages.get('missing') else "") |
|
+ ("\n " + ", ".join(messages['present']) + " present" if messages.get('present') else "") |
With PR #173 when calling
validation_errors = portfolio_exposure.check()the 'Class of business' is checked (feature for cyber model)If not detected this will always raise an
OedExceptionwhich ignores any validation config options givenODS_Tools/ods_tools/oed/common.py
Lines 182 to 192 in 39f4ee6
From:
ODS_Tools/ods_tools/oed/exposure.py
Lines 171 to 174 in 39f4ee6