Skip to content

check_multiple_sources_joined

This check validates that a staging model does not use two sources.

The best practice for project structure is to have a 1:1 relationship between sources and their staging models. This ensures that a single location is used for the initial transformations of a raw source table, such as renaming and recasting fields from the 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: dict):
    direct_sources = [p for p in parents if p["resource_type"] == "source"]
    assert len(direct_sources) <= 1