Exceptionsο
- exception AliasConflict(*, alias: str, ctx: TraverseContext)ο
Thrown when an alias shadows a table name or another alias name.
- Parameters:
alias (str) β The alias that conflicts with another name.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception AmbiguousParse(*, trees: list[lark.tree.Tree[ForwardRef('Token')]], ctx: TraverseContext)ο
Thrown when our grammar parses the unwrapped LLM output, but the query results in multiple parse trees unexpectedly. This is a bug in our grammar, and it should be reported to the author via the link in the exceptionβs output.
- Parameters:
trees (list[lark.tree.Tree[ForwardRef('Token')]]) β The list of parse trees that were generated from parsing the query.
query β The query that was attempted to be parsed.
ctx (TraverseContext) β The context of the Bifrost traversal.
- Variables:
issue_link β A link to the GitHub issue that should be opened to report this.
- exception BogusJoinedTable(*, table: str, ctx: TraverseContext)ο
Thrown when a tableβs join condition does not include the table itself.
- Parameters:
table (str) β The table that is not referenced in its own join condition.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception DisconnectedTable(*, table: str, ctx: TraverseContext)ο
Thrown when a table has joins, but the table in the
FROM
clause is not connected to any of those joins.- Parameters:
table (str) β The table that is not connected to a join.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception IllegalConditionColumn(*, column: FqColumn, ctx: TraverseContext)ο
Thrown when a column is used in a
JOIN
condition or aWHERE
condition that is not allowed by the constraint validator.- Parameters:
column (FqColumn) β The column that was used in the condition.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception IllegalFunction(*, function, ctx: TraverseContext)ο
Thrown when a disallowed SQL function has been used in the query.
- Parameters:
function β The lowercase name of the disallowed function.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception IllegalJoinTable(*, join: JoinCondition, ctx: TraverseContext)ο
Thrown when a join spec is not allowed by the constraint validator.
- Parameters:
join (JoinCondition) β The join spec that was not allowed.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception IllegalJoinType(*, join_type: str, ctx: TraverseContext)ο
Thrown when a non-inner JOIN type is found.
- Parameters:
join_type (str) β The type of JOIN that was found. This name comes directly from the grammar rule that captured it.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception IllegalSelectedColumn(*, column: str, ctx: TraverseContext)ο
Thrown when a column is selected that is not allowed by the constraint validator and it was not automatically removed because π§© Reconstruction is disabled.
- Parameters:
column (str) β The column that was selected. This is not a
FqColumn
because we may not always have a table name.ctx (TraverseContext) β The context of the Bifrost traversal.
- exception InvalidQuery(*, ctx: TraverseContext)ο
Thrown when our grammar cannot parse the unwrapped LLM output.
- Parameters:
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception MissingParameterizedConstraint(*, column: FqColumn, placeholder: str, ctx: TraverseContext)ο
Thrown when a parameterized constraint is missing from the query.
- Parameters:
column (FqColumn) β The column that is missing the constraint.
placeholder (str) β The name of the parameter placeholder for the constraint.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception MissingRequiredIdentity(*, identities: set[heimdallm.bifrosts.sql.common.ParameterizedConstraint], ctx: TraverseContext)ο
Thrown when a query is missing a required requester identity.
- Parameters:
identities (set[heimdallm.bifrosts.sql.common.ParameterizedConstraint]) β The set of identities that are missing.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception ReservedKeyword(*, keyword: str, ctx: TraverseContext)ο
Thrown when a the query attempts to use a reserved keyword, unescaped, as an alias for a table or column.
- Parameters:
keyword (str) β The reserved keyword that was used as an alias.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception TooManyRows(*, limit: int | None, ctx: TraverseContext)ο
Thrown when a query returns too many rows and π§© Reconstruction is disabled.
- Parameters:
limit (int | None) β The number of rows that the query wants to return. Nullable if no limit is specified.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception UnqualifiedColumn(*, column: str, ctx: TraverseContext)ο
Thrown when a column isnβt fully qualified in the form
table.column
.- Parameters:
column (str) β The column that was not fully qualified.
ctx (TraverseContext) β The context of the Bifrost traversal.
- exception UnsupportedQuery(*, msg: str, ctx: TraverseContext)ο
A query may be valid, but not yet supported by our parser.
- Parameters:
msg (str) β The reason why it is unsupported.
ctx (TraverseContext) β The context of the Bifrost traversal.