Skip to content

fenic.core.error

Fenic error hierarchy.

Classes:

CatalogAlreadyExistsError

CatalogAlreadyExistsError(catalog_name: str)

Bases: CatalogError

Catalog already exists.

Initialize a catalog already exists error.

Parameters:

  • catalog_name (str) –

    The name of the catalog that already exists.

Source code in src/fenic/core/error.py
131
132
133
134
135
136
137
def __init__(self, catalog_name: str):
    """Initialize a catalog already exists error.

    Args:
        catalog_name: The name of the catalog that already exists.
    """
    super().__init__(f"Catalog '{catalog_name}' already exists")

CatalogError

Bases: FenicError

Catalog and table management errors.

CatalogNotFoundError

CatalogNotFoundError(catalog_name: str)

Bases: CatalogError

Catalog doesn't exist.

Initialize a catalog not found error.

Parameters:

  • catalog_name (str) –

    The name of the catalog that was not found.

Source code in src/fenic/core/error.py
119
120
121
122
123
124
125
def __init__(self, catalog_name: str):
    """Initialize a catalog not found error.

    Args:
        catalog_name: The name of the catalog that was not found.
    """
    super().__init__(f"Catalog '{catalog_name}' does not exist")

CloudExecutionError

CloudExecutionError(error_message: str)

Bases: ExecutionError

Errors during physical plan execution in a cloud session.

Initialize a cloud execution error.

Parameters:

  • error_message (str) –

    The error message describing what went wrong.

Source code in src/fenic/core/error.py
209
210
211
212
213
214
215
216
217
def __init__(self, error_message: str):
    """Initialize a cloud execution error.

    Args:
        error_message: The error message describing what went wrong.
    """
    super().__init__(
        f"{error_message}. " "Please file a ticket with Typedef support."
    )

CloudSessionError

CloudSessionError(error_message: str)

Bases: SessionError

Cloud session lifecycle errors.

Initialize a cloud session error.

Parameters:

  • error_message (str) –

    The error message describing what went wrong.

Source code in src/fenic/core/error.py
34
35
36
37
38
39
40
41
42
def __init__(self, error_message: str):
    """Initialize a cloud session error.

    Args:
        error_message: The error message describing what went wrong.
    """
    super().__init__(
        f"{error_message}. " "Please file a ticket with Typedef support."
    )

ColumnNotFoundError

ColumnNotFoundError(column_name: str, available_columns: List[str])

Bases: PlanError

Column doesn't exist.

Initialize a column not found error.

Parameters:

  • column_name (str) –

    The name of the column that was not found.

  • available_columns (List[str]) –

    List of column names that are available.

Source code in src/fenic/core/error.py
68
69
70
71
72
73
74
75
76
77
78
def __init__(self, column_name: str, available_columns: List[str]):
    """Initialize a column not found error.

    Args:
        column_name: The name of the column that was not found.
        available_columns: List of column names that are available.
    """
    super().__init__(
        f"Column '{column_name}' not found. "
        f"Available columns: {', '.join(sorted(available_columns))}"
    )

ConfigurationError

Bases: FenicError

Errors during session configuration or initialization.

DatabaseAlreadyExistsError

DatabaseAlreadyExistsError(database_name: str)

Bases: CatalogError

Database already exists.

Initialize a database already exists error.

Parameters:

  • database_name (str) –

    The name of the database that already exists.

Source code in src/fenic/core/error.py
190
191
192
193
194
195
196
def __init__(self, database_name: str):
    """Initialize a database already exists error.

    Args:
        database_name: The name of the database that already exists.
    """
    super().__init__(f"Database '{database_name}' already exists")

DatabaseNotFoundError

DatabaseNotFoundError(database_name: str)

Bases: CatalogError

Database doesn't exist.

Initialize a database not found error.

Parameters:

  • database_name (str) –

    The name of the database that was not found.

Source code in src/fenic/core/error.py
178
179
180
181
182
183
184
def __init__(self, database_name: str):
    """Initialize a database not found error.

    Args:
        database_name: The name of the database that was not found.
    """
    super().__init__(f"Database '{database_name}' does not exist")

ExecutionError

Bases: FenicError

Errors during physical plan execution.

FenicError

Bases: Exception

Base exception for all fenic errors.

InternalError

Bases: FenicError

Internal invariant violations.

InvalidExampleCollectionError

Bases: ValidationError

Exception raised when a semantic example collection is invalid.

LineageError

Bases: FenicError

Errors during lineage traversal.

PlanError

Bases: FenicError

Errors during logical plan construction and validation.

SessionError

Bases: ConfigurationError

Session lifecycle errors.

TableAlreadyExistsError

TableAlreadyExistsError(table_name: str, database: Optional[str] = None)

Bases: CatalogError

Table already exists.

Initialize a table already exists error.

Parameters:

  • table_name (str) –

    The name of the table that already exists.

  • database (Optional[str], default: None ) –

    Optional name of the database containing the table.

Source code in src/fenic/core/error.py
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
def __init__(self, table_name: str, database: Optional[str] = None):
    """Initialize a table already exists error.

    Args:
        table_name: The name of the table that already exists.
        database: Optional name of the database containing the table.
    """
    if database:
        table_ref = f"{database}.{table_name}"
    else:
        table_ref = table_name
    super().__init__(
        f"Table '{table_ref}' already exists. "
        f"Use mode='overwrite' to replace the existing table."
    )

TableNotFoundError

TableNotFoundError(table_name: str, database: str)

Bases: CatalogError

Table doesn't exist.

Initialize a table not found error.

Parameters:

  • table_name (str) –

    The name of the table that was not found.

  • database (str) –

    The name of the database containing the table.

Source code in src/fenic/core/error.py
143
144
145
146
147
148
149
150
151
152
def __init__(self, table_name: str, database: str):
    """Initialize a table not found error.

    Args:
        table_name: The name of the table that was not found.
        database: The name of the database containing the table.
    """
    self.table_name = table_name
    self.database = database
    super().__init__(f"Table '{database}.{table_name}' does not exist")

TypeMismatchError

TypeMismatchError(expected: DataType, actual: DataType, context: str)

Bases: PlanError

Type validation errors.

Initialize a type mismatch error.

Parameters:

  • expected (DataType) –

    The expected data type.

  • actual (DataType) –

    The actual data type that was found.

  • context (str) –

    Additional context about where the type mismatch occurred.

Methods:

  • from_message

    Create a TypeMismatchError from a message string.

Source code in src/fenic/core/error.py
84
85
86
87
88
89
90
91
92
def __init__(self, expected: DataType, actual: DataType, context: str):
    """Initialize a type mismatch error.

    Args:
        expected: The expected data type.
        actual: The actual data type that was found.
        context: Additional context about where the type mismatch occurred.
    """
    super().__init__(f"{context}: expected {expected}, got {actual}")

from_message classmethod

from_message(msg: str) -> TypeMismatchError

Create a TypeMismatchError from a message string.

Parameters:

  • msg (str) –

    The error message.

Returns:

Source code in src/fenic/core/error.py
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
@classmethod
def from_message(cls, msg: str) -> TypeMismatchError:
    """Create a TypeMismatchError from a message string.

    Args:
        msg: The error message.

    Returns:
        A new TypeMismatchError instance with the given message.
    """
    instance = cls.__new__(cls)  # Bypass __init__
    super(TypeMismatchError, instance).__init__(msg)
    return instance

ValidationError

Bases: FenicError

Invalid usage of public APIs or incorrect arguments.