[Python] FIx Contextualizer validation to arguments (#168)

Closes #164

---------

Co-authored-by: Will Jones <willjones127@gmail.com>
This commit is contained in:
Nithin PS
2023-06-12 21:50:09 +05:30
committed by GitHub
parent 0e981e782b
commit 7bad676f30
2 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,16 @@
"""Custom exception handling"""
class MissingValueError(ValueError):
"""Exception raised when a required value is missing."""
pass
class MissingColumnError(KeyError):
"""
Exception raised when a column name specified is not in
the DataFrame object
"""
def __init__(self, column_name):
self.column_name = column_name
def __str__(self):
return f"Error: Column '{self.column_name}' does not exist in the DataFrame object"