Skip to content

Fix: clean signal registry before loading signals for the given project#5088

Merged
izeigerman merged 1 commit intoSQLMesh:mainfrom
z3z1ma:fix/clear-registry-before-load-signals
Aug 1, 2025
Merged

Fix: clean signal registry before loading signals for the given project#5088
izeigerman merged 1 commit intoSQLMesh:mainfrom
z3z1ma:fix/clear-registry-before-load-signals

Conversation

@z3z1ma
Copy link
Contributor

@z3z1ma z3z1ma commented Aug 1, 2025

Signals for a given project are registered explicitly by importing files in ./signals. In macros, the global registry of "standard macros" is copied out at the beginning of load, and user defined macros are loaded, then registry is set back to its old state. We do the same here now.

the issue is when you copy paste a signal from project A to project B
https://github.com/z3z1ma/sqlmesh/blob/6ed83334ef95cc23146eef6ff76731d1252e6665/sqlmesh/utils/__init__.py#L135-L140
this code will not raise a ValueError in the unique key dict subtly masking the fact that the signal that will persist is from project A. this mean project B in metaprogramming will not share subpath with module and will be registered as an import payload

@z3z1ma z3z1ma force-pushed the fix/clear-registry-before-load-signals branch from 6ed8333 to 8ecc56e Compare August 1, 2025 03:19
@izeigerman izeigerman merged commit fd59919 into SQLMesh:main Aug 1, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants