Skip to content

Conversation

@ross-whatnot
Copy link
Contributor

As discussed here, adding children to models / sources / snapshots. This is a simple addition to the logic that populates parents; basically, if x is one of y's parents, then y is one of x's children.

This allows writing rules like:

@rule(severity=Severity.CRITICAL)
def children_of_beta_models_should_be_beta_models(
    model: Model,
) -> RuleViolation | None:
    """Children of beta models should be beta models"""
    if "beta" in model.tags:
        for child in model.children:
            if "beta" not in child.tags:
                return RuleViolation(
                    message=f"Beta model {model.name} has a child that isn't a beta model {child.name}"
                )
    return None

This will need to be updated slightly for new evaluable types, but that should be easy.

@ross-whatnot ross-whatnot marked this pull request as ready for review April 30, 2025 20:29
Copy link
Contributor

@jochemvandooren jochemvandooren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice! 🚀

@jochemvandooren
Copy link
Contributor

Hey @ross-whatnot! I just merged #110, which means seeds are now included. Would you be able to make the small change (rebase + add children to seeds), then I can merge and release this new feature!

@ross-whatnot
Copy link
Contributor Author

OK @jochemvandooren , that should be all hooked up now!

Co-authored-by: Jochem van Dooren <[email protected]>
@jochemvandooren jochemvandooren enabled auto-merge (squash) May 6, 2025 14:45
@jochemvandooren jochemvandooren merged commit f8820ff into PicnicSupermarket:master May 6, 2025
4 checks passed
@jochemvandooren
Copy link
Contributor

Awesome @ross-whatnot! I will release a new version ASAP

@jochemvandooren jochemvandooren linked an issue May 21, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Exposures and children

2 participants