Skip to content

Exception allways rasied if 'buisness is missing' is not detected. #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sambles opened this issue Feb 3, 2025 · 0 comments
Open

Exception allways rasied if 'buisness is missing' is not detected. #174

sambles opened this issue Feb 3, 2025 · 0 comments
Assignees

Comments

@sambles
Copy link
Contributor

sambles commented Feb 3, 2025

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 "")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants