Fix: handle duplicate model names across sql, python and external models#3945
Merged
georgesittas merged 9 commits intoSQLMesh:mainfrom Mar 13, 2025
Merged
Conversation
3338b4c to
8cee823
Compare
8cee823 to
c242e1d
Compare
izeigerman
approved these changes
Mar 5, 2025
georgesittas
reviewed
Mar 5, 2025
Contributor
georgesittas
left a comment
There was a problem hiding this comment.
Let's add a test for this.
lafirm
commented
Mar 6, 2025
36da37e to
2f34480
Compare
georgesittas
approved these changes
Mar 12, 2025
2f34480 to
d627be6
Compare
d627be6 to
d660fde
Compare
Contributor
Author
|
@georgesittas, made the changes recommended and renamed slow to cicd tests in circleci which I felt irrelevant. Please let me know what you think. Thanks :) |
Contributor
Let's revert that change for now please. |
Contributor
Author
alright, consider it done. Thanks and apologies for that 😊 |
afzaljasani
pushed a commit
that referenced
this pull request
Apr 8, 2025
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.
Recently, I encountered an issue where I mistakenly named my Python model the same as an SQL model, resulting in the SQL model being overwritten by the Python model. I believe we should not allow users to have multiple models with the same name across all types – SQL, Python, and external models (currently, duplicate names are only handled within the same type, i.e., you can't create two or more SQL models with the same name or two or more Python models with the same name because of UniqueKeyDict Class).
I found that this issue has already been raised here, so I made some assumptions and implemented a simple fix. Please review and let me know your feedback. Thanks!