@@ -239,7 +239,8 @@ def delete_embedding():
239239
240240
241241 job_id = str (uuid .uuid4 ())
242- command = f'rm -rf "{ os .path .join (DATA_DIR , dataset , "embeddings" , f"{ embedding_id } *" )} "'
242+ path = os .path .join (DATA_DIR , dataset , "embeddings" , f"{ embedding_id } *" ).replace (" " , "\\ " )
243+ command = f'rm -rf { path } '
243244 for umap in umaps_to_delete :
244245 delete_umap (dataset , umap )
245246 threading .Thread (target = run_job , args = (dataset , job_id , command )).start ()
@@ -284,10 +285,12 @@ def delete_umap(dataset, umap_id):
284285
285286
286287 job_id = str (uuid .uuid4 ())
287- command = f'rm -rf "{ os .path .join (DATA_DIR , dataset , "umaps" , f"{ umap_id } *" )} "'
288+ path = os .path .join (DATA_DIR , dataset , "umaps" , f"{ umap_id } *" ).replace (" " , "\\ " )
289+ command = f'rm -rf { path } '
288290 # Create the rm -rf commands from the clusters_to_delete list
289291 for cluster in clusters_to_delete :
290- command += f'; rm "{ os .path .join (DATA_DIR , dataset , "clusters" , f"{ cluster } *" )} "'
292+ cpath = os .path .join (DATA_DIR , dataset , "clusters" , f"{ cluster } *" ).replace (" " , "\\ " )
293+ command += f'; rm -rf { cpath } '
291294 threading .Thread (target = run_job , args = (dataset , job_id , command )).start ()
292295 return jsonify ({"job_id" : job_id })
293296
@@ -310,7 +313,8 @@ def delete_cluster():
310313 dataset = request .args .get ('dataset' )
311314 cluster_id = request .args .get ('cluster_id' )
312315 job_id = str (uuid .uuid4 ())
313- command = f'rm -rf "{ os .path .join (DATA_DIR , dataset , "clusters" , f"{ cluster_id } *" )} "'
316+ path = os .path .join (DATA_DIR , dataset , "clusters" , f"{ cluster_id } *" ).replace (" " , "\\ " )
317+ command = f'rm -rf { path } '
314318 threading .Thread (target = run_job , args = (dataset , job_id , command )).start ()
315319 return jsonify ({"job_id" : job_id })
316320
@@ -354,7 +358,8 @@ def delete_scope():
354358 scope_id = request .args .get ('scope_id' )
355359
356360 job_id = str (uuid .uuid4 ())
357- command = f'rm -rf "{ os .path .join (DATA_DIR , dataset , "scopes" , f"{ scope_id } *" )} "'
361+ path = os .path .join (DATA_DIR , dataset , "scopes" , f"{ scope_id } *" ).replace (" " , "\\ " )
362+ command = f'rm -rf { path } '
358363 threading .Thread (target = run_job , args = (dataset , job_id , command )).start ()
359364 return jsonify ({"job_id" : job_id })
360365
0 commit comments