1414)
1515from sqlbuild .compiler .compile .classes .macro_expansion_facts import MacroExpansionFacts
1616from sqlbuild .compiler .compile .constants import MACRO_TOKEN
17- from sqlbuild .compiler .compile .exceptions import CompileInputError , NativeRenderMismatchError
17+ from sqlbuild .compiler .compile .exceptions import CompileInputError
1818from sqlbuild .compiler .compile .models import (
1919 DeclarationResolutionContext ,
2020 ExpansionSpan ,
2121 MacroExpansionState ,
2222)
23+ from sqlbuild .compiler .frontier .exceptions import NativeStageMismatchError
2324from sqlbuild .compiler .macro_bridge .classes .macro_bridge import MacroBridge
2425from sqlbuild .compiler .macro_bridge .constants import (
2526 ARGUMENT_REFERENCE_EVENT ,
@@ -139,7 +140,7 @@ def _bridged_call_output( # noqa: PLR0913
139140 "directly in SQL"
140141 )
141142 if next_index != site .end :
142- raise NativeRenderMismatchError (
143+ raise NativeStageMismatchError (
143144 f"Native macro call scan of '{ consumer_path } ' ended at { site .end } , Python at "
144145 f"{ next_index } "
145146 )
@@ -177,7 +178,7 @@ def _replay_macro_call_event(
177178 )
178179 elif tag == DECLARATION_READ_EVENT :
179180 if declarations is None :
180- raise NativeRenderMismatchError ("Replayed a declaration read without declarations" )
181+ raise NativeStageMismatchError ("Replayed a declaration read without declarations" )
181182 _record_macro_declaration_usage (
182183 name = second , kind = DeclarationKind (first ), declarations = declarations , state = state
183184 )
@@ -198,4 +199,4 @@ def _replay_macro_call_event(
198199 (SqlResourceRef (kind = SqlResourceRefKind (first ), name = second ),)
199200 )
200201 else :
201- raise NativeRenderMismatchError (f"Unknown macro call event { tag } " )
202+ raise NativeStageMismatchError (f"Unknown macro call event { tag } " )
0 commit comments