Skip to content

check_source_fanout

This check validates that a source is only used directly by a single model.

It's best practice to "wrap" each source with a single view that performs basic operations like renaming fields, casting data types, and other operations. Any other transformations related to operations like joining, filtering, or applying business logic should be left for further later in the pipeline.

Parameters

This check does not support any custom parameters.

Info

For more information about how to set custom parameters for a check, see the documentation on configuration.

Source

def check(source: dict, children: list[dict]):
    child_models = [m["name"] for m in children if m["resource_type"] == "model"]
    assert len(child_models) < 2