Skip to content

Commit 54df173

Browse files
authored
Merge pull request #29 from nirupama-dev/main
Fixed issue: Composer cannot schedule notebook in subfolders
2 parents 7e9c709 + 609d1fd commit 54df173

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scheduler_jupyter_plugin/services/executor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ async def prepare_dag(self, job, gcs_dag_bucket, dag_file, project_id, region_id
232232
)
233233
template = environment.get_template(DAG_TEMPLATE_CLUSTER_V1)
234234
if not job.input_filename.startswith(GCS):
235-
input_notebook = f"gs://{gcs_dag_bucket}/dataproc-notebooks/{job.name}/input_notebooks/{job.input_filename}"
235+
trimmed_input_filename = job.input_filename.split('/')[-1]
236+
input_notebook = f"gs://{gcs_dag_bucket}/dataproc-notebooks/{job.name}/input_notebooks/{trimmed_input_filename}"
236237
else:
237238
input_notebook = job.input_filename
238239
content = template.render(
@@ -305,7 +306,8 @@ async def prepare_dag(self, job, gcs_dag_bucket, dag_file, project_id, region_id
305306
else:
306307
template = environment.get_template(DAG_TEMPLATE_LOCAL_V1)
307308
if not job.input_filename.startswith(GCS):
308-
input_notebook = f"gs://{gcs_dag_bucket}/dataproc-notebooks/{job.name}/input_notebooks/{job.input_filename}"
309+
trimmed_input_filename = job.input_filename.split('/')[-1]
310+
input_notebook = f"gs://{gcs_dag_bucket}/dataproc-notebooks/{job.name}/input_notebooks/{trimmed_input_filename}"
309311
else:
310312
input_notebook = job.input_filename
311313
if len(job.parameters) != 0:

0 commit comments

Comments
 (0)