CheckResult

CheckResult(
    check_id,
    check_name,
    group,
    severity,
    status,
    message=None,
    hint=None,
    locations=list(),
    skip_reason=None,
    error=None,
    duration_ms=None,
    url=None,
)

Result of running a single check.

Use factory methods (passed, failed, skipped, errored, not_applicable) to create instances.

Methods

Name Description
errored Create an ERRORED result (check itself failed to run).
failed Create a FAILED result.
not_applicable Create a NOT_APPLICABLE result.
passed Create a PASSED result.
skipped Create a SKIPPED result.

errored

CheckResult.errored(
    check_id,
    check_name,
    group,
    error,
    severity=Severity.ERROR,
    duration_ms=None,
    url=None,
)

Create an ERRORED result (check itself failed to run).

Args: check_id: Unique identifier for the check check_name: Human-readable check name group: Check group (e.g., “metadata”, “structure”) error: The exception that occurred severity: Severity level (default ERROR) duration_ms: Check duration in milliseconds url: Documentation URL for the check

Returns: CheckResult with ERRORED status

failed

CheckResult.failed(
    check_id,
    check_name,
    group,
    severity,
    message,
    hint=None,
    locations=None,
    duration_ms=None,
    url=None,
)

Create a FAILED result.

Args: check_id: Unique identifier for the check check_name: Human-readable check name group: Check group (e.g., “metadata”, “structure”) severity: Severity level (ERROR, WARNING, or NOTE) message: Description of the failure hint: Optional suggestion for fixing the issue locations: Optional list of source locations duration_ms: Check duration in milliseconds url: Documentation URL for the check

Returns: CheckResult with FAILED status

not_applicable

CheckResult.not_applicable(
    check_id,
    check_name,
    group,
    message,
    severity=Severity.NOTE,
    duration_ms=None,
    url=None,
)

Create a NOT_APPLICABLE result.

Args: check_id: Unique identifier for the check check_name: Human-readable check name group: Check group (e.g., “metadata”, “structure”) message: Explanation of why check is not applicable severity: Severity level (default NOTE) duration_ms: Check duration in milliseconds url: Documentation URL for the check

Returns: CheckResult with NOT_APPLICABLE status

passed

CheckResult.passed(
    check_id,
    check_name,
    group,
    severity=Severity.NOTE,
    duration_ms=None,
    url=None,
)

Create a PASSED result.

Args: check_id: Unique identifier for the check check_name: Human-readable check name group: Check group (e.g., “metadata”, “structure”) severity: Severity level (default NOTE) duration_ms: Check duration in milliseconds url: Documentation URL for the check

Returns: CheckResult with PASSED status

skipped

CheckResult.skipped(
    check_id,
    check_name,
    group,
    skip_reason,
    severity=Severity.NOTE,
    duration_ms=None,
    url=None,
)

Create a SKIPPED result.

Args: check_id: Unique identifier for the check check_name: Human-readable check name group: Check group (e.g., “metadata”, “structure”) skip_reason: Reason why the check was skipped severity: Severity level (default NOTE) duration_ms: Check duration in milliseconds url: Documentation URL for the check

Returns: CheckResult with SKIPPED status