Skip to content

check_rejoining_upstream_concepts

This check identifies unnecessary "loops" in the dag.

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], manifest: Manifest):
    parent_node_ids = [p["unique_id"] for p in parents]
    grand_parent_node_ids = [
        gp["unique_id"] for p in parents for gp in manifest.get_parents(p["unique_id"])
    ]
    for p in parent_node_ids:
        if len(manifest.get_parents(p)) == 1:
            gp_id = manifest.get_parents(p)[0]["unique_id"]
            assert gp_id not in grand_parent_node_ids