Feat: add glob pattern matching to --paths#3373
Merged
tobymao merged 7 commits intoSQLMesh:mainfrom Nov 18, 2024
Merged
Conversation
Contributor
Author
|
To use wildcards enclose path in '' or "" |
Harmuth94
commented
Nov 15, 2024
| Path(t.cast(t.Union[str, Path], path)).absolute() for path in ensure_list(paths) | ||
| Path(t.cast(t.Union[str, Path], p)).absolute() | ||
| for path in ensure_list(paths) | ||
| for p in (glob.glob(str(path)) or [str(path)]) |
Contributor
Author
There was a problem hiding this comment.
glob.glob() returns None for absolute paths
Contributor
There was a problem hiding this comment.
Can you share an example for this?
Contributor
Author
There was a problem hiding this comment.
Did some digging and it was not the absolute paths.
The issue is that glob.glob returns an empty list if the pattern doesn't match anything (This was the case for a few pytest cases). The load_configs function would return an unexpected empty dictionary and cause downstream issues.
Adding or [str(path)] for the non-existing path will enable the correct downstream invalidation of the path/config.
Contributor
There was a problem hiding this comment.
I see, seems reasonable.
georgesittas
approved these changes
Nov 15, 2024
erindru
approved these changes
Nov 17, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closing #3372
Using
glob.globto allow for pattern matching in the--pathsargument.