Loading...

verticapy.errors.ConversionError#

exception verticapy.errors.ConversionError#

An exception raised when an error occurs during the process of converting data from one type or format to another.

This error typically indicates issues such as data type discrepancies, incompatible formats, or challenges in the conversion process.

Examples#

The following function verifies whether the input, treated as a varchar, is of float datatype. If not, it raises an error.

def is_convertible(dtype: str):

    if dtype != "float":

        raise ConversionError(
            "The function exclusively accepts float values."
        )

Note

Errors can be employed when implementing new functions to provide clear explanations for why a particular option or feature is not functioning as intended. It is essential to review all available errors to choose the most appropriate one.