INNER CODE UNIT · Python

check_matrix_properties

trinodb/trino · .github/bin/build-matrix-schedule-aware.py:234

def check_matrix_properties(matrix_properties: dict[str, Any]) -> None:
    """Validate that the matrix-properties object doesn't override reserved matrix keys."""
    reserved = {"modules", "profile", "runners", "notify-channels", "name"}
    conflicts = reserved.intersection(matrix_properties.keys())
    if conflicts:
        raise ValueError(
            f"matrix-properties contains reserved keys: {sorted(conflicts)}"
        )


def load_when(item: dict[str, Any]) -> ScheduleFilter:
    return ScheduleFilter(
        pushes=_require_type(item.get("pushes", False), bool, "pushes"),
        dispatches=_require_type(item.get("dispatches", True), bool, "dispatches"),
        impacted=_require_type(item.get("impacted", True), bool, "impacted"),
        scheduled=Schedule(
            _require_type(item.get("scheduled", "nightly"), str, "scheduled")
        ),

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…