Fix duplicate external model generation from directory files#5897
Open
reachsrinivaschennupati-tech wants to merge 2 commits into
Open
Conversation
Signed-off-by: srinivas chennupati <reachsrinivaschennupati@gmail.com>
Author
|
Hi maintainers, this PR is ready for review when you have a chance. I kept the change focused on preventing generated external model entries from duplicating models that are already explicitly defined under the external models directory. The PR includes regression coverage for the mixed case where a project has both a SQL model dependency and an existing external model YAML definition. Validation noted in the PR:
Happy to make any adjustments if you prefer a different boundary for the generated-vs-explicit external model handling. |
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.
Summary
Fixes duplicate external model generation when external models are already defined in the
external_modelsdirectory.Problem
create_external_models_fileconsidered every external model in the loaded model set, including models that originated from the configured external models directory. That could cause SQLMesh to regenerate an external model entry that was already explicitly defined by the project.Solution
external_modelsdirectory without writing duplicate generated entries.Validation
Fixes #5880