INNER CODE UNIT · Python

_expect_str_list

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

def _expect_str_list(d: dict[str, Any], key: str) -> list[str]:
    values = _require_type(d.get(key, []), list, key)
    return [_require_type(value, str) for value in values]


def _expect_str_lists(d: dict[str, Any], key: str) -> list[list[str]]:
    """
    Parses a schedule config's "modules" field into a list of module sets (one matrix job each).

    A single string, e.g. a, or a flat list of strings, e.g. [a, b], is shorthand for a single
    module set (respectively [[a]] or [[a, b]]) that runs all its modules in one job. Nest lists
    explicitly, e.g. [[a], [b, c]], to define multiple module sets that share the rest of the
    schedule item's config (profiles, when, etc).
    """
    raw = d.get(key, [])
    if isinstance(raw, str):
        return [[raw]]
    values = _require_type(raw, list, key)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…