Skip to content

check_direct_join_to_source

This check validates that a staging model depends on only a single source.

It's a best practice for staging models to have a one-to-one relationship with their source.

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(model: dict, parents: list[dict]):
    if is_staging_model(model):
        upstream_models = [p for p in parents if p["resource_type"] == "model"]
        assert len(upstream_models) == 0