From 189aefa755c95f39413ea6b1aad16e51a28a6b0f Mon Sep 17 00:00:00 2001 From: Nathan Freeman Date: Wed, 11 Oct 2023 10:52:26 -0500 Subject: [PATCH] use dict notation to access tasks from pipeline template --- src/api/src/backend/views/ETLPipelines.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/api/src/backend/views/ETLPipelines.py b/src/api/src/backend/views/ETLPipelines.py index 1674fdc5..f5201d50 100644 --- a/src/api/src/backend/views/ETLPipelines.py +++ b/src/api/src/backend/views/ETLPipelines.py @@ -220,8 +220,6 @@ def post(self, request, group_id, *_, **__): # Create a tapis job task for each job provided in the request. tasks = [] - print("BODY") - pprint(body) for i, job in enumerate(body.jobs, start=1): task_id = f"etl-job-{i}" tasks.append( @@ -229,16 +227,13 @@ def post(self, request, group_id, *_, **__): "id": task_id, "type": "tapis_job", "tapis_job_def": job, - "dependencies": [{"id": last_task_id}] + "depends_on": [{"id": last_task_id}] }) ) last_task_id = task_id - print("TASKS") - pprint(tasks) - # Add the tasks from the template to the tasks list - tasks.extend([TemplateTask(**task) for task in pipeline_template.tasks]) + tasks.extend([TemplateTask(**task) for task in pipeline_template.get("tasks")]) print("AFTER TASK REQUEST CREATE") # Update the dependecies of the gen-outbound-manifests task to @@ -252,6 +247,7 @@ def post(self, request, group_id, *_, **__): for task in tasks: try: task_service.create(pipeline, task) + print("TASK CREATED", task) except (ValidationError, BadRequestError) as e: pipeline.delete() task_service.delete(tasks)