Loading...

vastorbit.errors.MissingSchema

exception vastorbit.errors.MissingSchema

An exception raised when attempting to perform an operation that requires a specified schema or structure that is missing or not provided. This error typically indicates the absence of essential information needed for the operation to proceed successfully.

Examples

The following function checks for the existence of the input schema and raises an error if it does not exist.

from vastorbit._utils._sql._sys import _executeSQL
from vastorbit.errors import MissingSchema

def does_schema_exists(schema: str):

    query = f"SELECT * FROM columns WHERE table_schema = '{schema}';"
    result = _executeSQL(query, method="fetchall")
    assert result, MissingSchema(
        f"The schema '{schema}' does not exist."
    )

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.