@@ -20,7 +20,7 @@ use windmill_queue::{CanceledBy, MiniPulledJob, HTTP_CLIENT};
2020
2121use serde:: { Deserialize , Serialize } ;
2222
23- use crate :: common:: build_args_values;
23+ use crate :: common:: { build_args_values, get_reserved_variables } ;
2424use crate :: common:: {
2525 build_http_client, resolve_job_timeout, s3_mode_args_to_worker_data, OccupancyMetrics ,
2626 S3ModeWorkerData ,
@@ -132,12 +132,14 @@ fn do_snowflake_inner<'a>(
132132 skip_collect : bool ,
133133 http_client : & ' a Client ,
134134 s3 : Option < S3ModeWorkerData > ,
135+ reserved_variables : & HashMap < String , String > ,
135136) -> windmill_common:: error:: Result < BoxFuture < ' a , windmill_common:: error:: Result < Box < RawValue > > > > {
136137 let sig = parse_snowflake_sig ( & query)
137138 . map_err ( |x| Error :: ExecutionErr ( x. to_string ( ) ) ) ?
138139 . args ;
139140
140- let ( query, args_to_skip) = & sanitize_and_interpolate_unsafe_sql_args ( query, & sig, & job_args) ?;
141+ let ( query, args_to_skip) =
142+ & sanitize_and_interpolate_unsafe_sql_args ( query, & sig, & job_args, reserved_variables) ?;
141143
142144 body. insert ( "statement" . to_string ( ) , json ! ( query) ) ;
143145
@@ -282,6 +284,7 @@ pub async fn do_snowflake(
282284 worker_name : & str ,
283285 column_order : & mut Option < Vec < String > > ,
284286 occupancy_metrics : & mut OccupancyMetrics ,
287+ parent_runnable_path : Option < String > ,
285288) -> windmill_common:: error:: Result < Box < RawValue > > {
286289 let snowflake_args = build_args_values ( job, client, conn) . await ?;
287290
@@ -403,6 +406,9 @@ pub async fn do_snowflake(
403406
404407 let http_client = build_http_client ( timeout_duration) ?;
405408
409+ let reserved_variables =
410+ get_reserved_variables ( job, & client. token , conn, parent_runnable_path) . await ?;
411+
406412 let result_f = if queries. len ( ) > 1 {
407413 let futures = queries
408414 . iter ( )
@@ -419,6 +425,7 @@ pub async fn do_snowflake(
419425 annotations. return_last_result && i < queries. len ( ) - 1 ,
420426 & http_client,
421427 s3. clone ( ) ,
428+ & reserved_variables,
422429 )
423430 } )
424431 . collect :: < windmill_common:: error:: Result < Vec < _ > > > ( ) ?;
@@ -449,6 +456,7 @@ pub async fn do_snowflake(
449456 false ,
450457 & http_client,
451458 s3. clone ( ) ,
459+ & reserved_variables,
452460 ) ?
453461 } ;
454462 let r = run_future_with_polling_update_job_poller (
0 commit comments