@@ -130,6 +130,7 @@ def __init__(
130130 )
131131 self .selected_gateway = selected_gateway
132132 self .ddl_concurrent_tasks = ddl_concurrent_tasks
133+ self .execution_tracker = QueryExecutionTracker ()
133134
134135 def evaluate (
135136 self ,
@@ -158,9 +159,7 @@ def evaluate(
158159 Returns:
159160 The WAP ID of this evaluation if supported, None otherwise.
160161 """
161- with QueryExecutionTracker .track_execution (
162- f"{ snapshot .snapshot_id } _{ batch_index } " , condition = not snapshot .is_seed
163- ):
162+ with self .execution_tracker .track_execution (f"{ snapshot .snapshot_id } _{ batch_index } " ):
164163 result = self ._evaluate_snapshot (
165164 snapshot ,
166165 start ,
@@ -204,19 +203,16 @@ def evaluate_and_fetch(
204203 Returns:
205204 The result of the evaluation as a dataframe.
206205 """
207- with QueryExecutionTracker .track_execution (
208- f"{ snapshot .snapshot_id } _0" , condition = not snapshot .is_seed
209- ):
210- result = self ._evaluate_snapshot (
211- snapshot ,
212- start ,
213- end ,
214- execution_time ,
215- snapshots ,
216- limit = limit ,
217- deployability_index = deployability_index ,
218- ** kwargs ,
219- )
206+ result = self ._evaluate_snapshot (
207+ snapshot ,
208+ start ,
209+ end ,
210+ execution_time ,
211+ snapshots ,
212+ limit = limit ,
213+ deployability_index = deployability_index ,
214+ ** kwargs ,
215+ )
220216 if result is None or isinstance (result , str ):
221217 raise SQLMeshError (
222218 f"Unexpected result { result } when evaluating snapshot { snapshot .snapshot_id } ."
@@ -903,18 +899,15 @@ def _create_snapshot(
903899 )
904900 continue
905901
906- with QueryExecutionTracker .track_execution (
907- f"{ snapshot .snapshot_id } _0" , condition = snapshot .is_seed
908- ):
909- self ._execute_create (
910- snapshot = snapshot ,
911- table_name = snapshot .table_name (is_deployable = is_table_deployable ),
912- is_table_deployable = is_table_deployable ,
913- deployability_index = deployability_index ,
914- create_render_kwargs = create_render_kwargs ,
915- rendered_physical_properties = rendered_physical_properties ,
916- dry_run = dry_run ,
917- )
902+ self ._execute_create (
903+ snapshot = snapshot ,
904+ table_name = snapshot .table_name (is_deployable = is_table_deployable ),
905+ is_table_deployable = is_table_deployable ,
906+ deployability_index = deployability_index ,
907+ create_render_kwargs = create_render_kwargs ,
908+ rendered_physical_properties = rendered_physical_properties ,
909+ dry_run = dry_run ,
910+ )
918911
919912 if on_complete is not None :
920913 on_complete (snapshot )
0 commit comments