Fix duplicate external model generation from directory files#5897
Conversation
|
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. |
803357c to
0a86936
Compare
Signed-off-by: srinivas chennupati <reachsrinivaschennupati@gmail.com>
0a86936 to
8d55174
Compare
|
@reachsrinivaschennupati-tech Thanks for this PR! One consideration - it might be preferable to have |
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