Skip to content

check_marts_or_intermediate_dependent_on_source

This check identifies intermediate or mart models that are dependent on sources.

It's best practice for a source to be first referenced by a staging model.

Version History

Added in Debby v0.2.0

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_mart_model(model) or is_intermediate_model(model):
        sources = [p for p in parents if p["resource_type"] == "source"]
        assert len(sources) == 0