File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 99import functools
1010import gc
1111import json
12+ import re
1213import logging
1314import os
1415import shlex
@@ -674,6 +675,9 @@ def _create_temp_node(
674675 self , sql : str , node_id : str | None = None
675676 ) -> tuple [ManifestNode , t .Callable [[], None ]]:
676677 """Create a temporary node for SQL execution/compilation."""
678+ # Remove only the opening and closing snapshot tags, keep the body
679+ sql = re .sub (r'{%\s*snapshot\b.*?%}' , '' , sql , flags = re .DOTALL )
680+ sql = re .sub (r'{%\s*endsnapshot\s*%}' , '' , sql , flags = re .DOTALL )
677681 node_id = node_id or f"temp_node_{ uuid .uuid4 ().hex [:8 ]} "
678682 sql_node = self .sql_parser .parse_remote (sql , node_id )
679683 process_node (self .runtime_config , self .manifest , sql_node )
You can’t perform that action at this time.
0 commit comments