Skip to content

Exceptions

bcql_py.exceptions

ValidationIssue dataclass

ValidationIssue(
    kind: IssueKind,
    message: str,
    node_type: str,
    context: dict[str, Any] = dict(),
)

A single semantic validation problem found during :func:bcql_py.validate. In practice, there may be multiple issues collected in a :class:BCQLValidationError to report them all at once instead of just the first one.

Attributes:

Name Type Description
kind IssueKind

A short machine-readable label identifying the issue category.

message str

Human-readable description of the problem.

node_type str

The node_type discriminator of the offending AST node.

context dict[str, Any]

Extra context (e.g. the offending annotation name, value, or tag).

BCQLValidationError

BCQLValidationError(issues: list[ValidationIssue])

Bases: Exception

Raised when an AST does not satisfy a :class:CorpusSpec.

Collects one or more :class:ValidationIssue instances so that callers can surface every problem at once (when fail_fast=False) or just the first (default).

Attributes:

Name Type Description
issues

One or more :class:ValidationIssue entries describing what went wrong.