POST /deployments/impact returns HTTP 500 with an unhandled psycopg.errors.UniqueViolation on unique_node_namespace_name when the deployment spec contains a node that already exists. Impact analysis should reconcile an existing node as an update (or report it in the impact result), and a genuine conflict should surface as a typed DJAlreadyExistsException (409), not a raw DB error escaping as a 500.
Repro (v0.0.193):
- Create transform
demo.scratch.foo.
POST /deployments/impact with a spec that bulk-creates demo.scratch.foo plus another node.
- Server bulk-
INSERTs into node, hits unique_node_namespace_name, and the IntegrityError propagates unhandled → 500.
Source: node-create path in datajunction_server/internal/deployment/orchestrator.py. A related unhandled TypeError occurs at datajunction_server/internal/deployment/orchestrator.py:1669 in _deploy_links on the same endpoint.
Fix: treat already-existing nodes as updates during impact/deploy, wrap node-create so a uniqueness conflict raises DJAlreadyExistsException (409) instead of leaking psycopg.IntegrityError, and guard the _deploy_links type error.
POST /deployments/impactreturns HTTP 500 with an unhandledpsycopg.errors.UniqueViolationonunique_node_namespace_namewhen the deployment spec contains a node that already exists. Impact analysis should reconcile an existing node as an update (or report it in the impact result), and a genuine conflict should surface as a typedDJAlreadyExistsException(409), not a raw DB error escaping as a 500.Repro (v0.0.193):
demo.scratch.foo.POST /deployments/impactwith a spec that bulk-createsdemo.scratch.fooplus another node.INSERTs intonode, hitsunique_node_namespace_name, and theIntegrityErrorpropagates unhandled → 500.Source: node-create path in
datajunction_server/internal/deployment/orchestrator.py. A related unhandledTypeErroroccurs atdatajunction_server/internal/deployment/orchestrator.py:1669in_deploy_linkson the same endpoint.Fix: treat already-existing nodes as updates during impact/deploy, wrap node-create so a uniqueness conflict raises
DJAlreadyExistsException(409) instead of leakingpsycopg.IntegrityError, and guard the_deploy_linkstype error.