Skip to content

ignore_patterns in config.yaml does not glob recursively #3507

@billwallis

Description

@billwallis

Warning

This might be a design choice. If it is, please close this 😋

Summary

The ignore_patterns configuration option in the config.yaml file takes a list of glob patterns.

However, the globbing isn't recursive: the pattern /**/ does not match any number of directories.

This might be a design choice, but it took me by surprise, as I'm used to /**/ matching zero or more directories.

Minimal working example

Consider a minimal SQLMesh project with the following structure:

config.yaml
models/
    models.sql
    domain/
        domain.sql
        user/
          user.sql

I've checked how SQLMesh ignores files by running sqlmesh info and checking the Models count in the console.

With ignore_patterns: [], SQLMesh finds 3 models as expected.

With ignore_patterns: ["models/*.sql"], SQLMesh finds 2 models as expected.

However, with ignore_patterns: ["models/**/*.sql"], SQLMesh still finds 2 models, whereas I was expecting it to find 0 models.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions