Skip to content

Commit

Permalink
debug. use model dump for conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
nathandf committed Nov 29, 2023
1 parent fe370a4 commit 1d0b354
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/api/src/backend/services/TaskService.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def create(self, pipeline, request):
code=getattr(request, "code", None),
command=getattr(request, "command", None),
context=context,
conditions=getattr(request, "conditions", []),
conditions=getattr(request, "conditions", []).model_dump(),
data=getattr(request, "data", None),
description=request.description,
destination=destination,
Expand Down Expand Up @@ -151,8 +151,9 @@ def create(self, pipeline, request):
except ModelValidationError as e:
self.rollback()
raise e
except Exception as e:
print(f"Generic Exception: {e}", request.id, flush=True)
except ServerError as e:
self.rollback()
# print(f"Generic Exception: {e}", request.id, flush=True)
raise e

return task
Expand Down
2 changes: 2 additions & 0 deletions src/api/src/backend/views/ETLPipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ def post(self, request, group_id, *_, **__):
task_service.delete(tasks)
return BadRequest(message=e.__cause__)
except ServerError as e:
pipeline.delete()
task_service.delete(tasks)
return ServerErrorResp(message=e)
except Exception as e:
task_service.delete(tasks)
Expand Down

0 comments on commit 1d0b354

Please sign in to comment.