From 3707b8aa797a5ae630d631e1bd09d8e2a798c1e2 Mon Sep 17 00:00:00 2001 From: Madhur Tandon Date: Wed, 26 Jun 2024 10:30:15 +0530 Subject: [PATCH] remove f-strings --- metaflow/plugins/snowpark/snowpark_client.py | 22 +++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/metaflow/plugins/snowpark/snowpark_client.py b/metaflow/plugins/snowpark/snowpark_client.py index d3782fcb953..a3272895d8a 100644 --- a/metaflow/plugins/snowpark/snowpark_client.py +++ b/metaflow/plugins/snowpark/snowpark_client.py @@ -70,22 +70,30 @@ def submit(self, name: str, spec, stage, compute_pool, external_integration): self.root.compute_pools[compute_pool].fetch() # upload the spec file to stage - result = self.session.file.put(snowpark_spec_file.name, f"@{stage}") + result = self.session.file.put(snowpark_spec_file.name, "@%s" % stage) service_name = name.replace("-", "_") external_access = ( - f"EXTERNAL_ACCESS_INTEGRATIONS=({external_integration}) " + "EXTERNAL_ACCESS_INTEGRATIONS=(%s) " % external_integration if external_integration else "" ) # cannot pass 'is_job' parameter using the API, thus we need to use SQL directly.. query = f""" - EXECUTE JOB SERVICE IN COMPUTE POOL {compute_pool} - NAME = {db}.{schema}.{service_name} - {external_access} - FROM @{stage} SPECIFICATION_FILE={result[0].target} - """ + EXECUTE JOB SERVICE IN COMPUTE POOL %s + NAME = %s.%s.%s + %s + FROM @%s SPECIFICATION_FILE=%s + """ % ( + compute_pool, + db, + schema, + service_name, + external_access, + stage, + result[0].target, + ) async_job = self.session.sql(query).collect(block=False) return async_job.query_id, service_name