Skip to content

fix: Validate UUID format in CreateOperationNodePayload#1373

Draft
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/uuid-validation-operation-nodes
Draft

fix: Validate UUID format in CreateOperationNodePayload#1373
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/uuid-validation-operation-nodes

Conversation

@sentry
Copy link
Copy Markdown

@sentry sentry Bot commented May 23, 2026

This PR addresses issue DALGO-BACKEND-26F by enforcing UUID format validation at the API schema level for operation node creation.

Previously, the input_node_uuid in CreateOperationNodePayload and input_model_uuid in ModelSrcOtherInputPayload were defined as plain str. This allowed non-UUID strings (e.g., numeric IDs like '1772272235615') to pass initial schema validation, only to cause a ValidationError when Django's UUIDField attempted to process them during ORM queries (e.g., CanvasNode.objects.get(uuid=...)).

Changes Made:

  • Modified ddpui/schemas/dbt_workflow_schema.py:
    • Added import uuid.
    • Changed input_node_uuid in CreateOperationNodePayload from str to uuid.UUID.
    • Changed input_model_uuid in ModelSrcOtherInputPayload from str to uuid.UUID.

Impact:

  • Pydantic (used by Ninja) will now automatically validate that input_node_uuid and input_model_uuid are valid UUID strings. Requests with invalid formats will receive a 422 Unprocessable Entity error with a clear validation message, preventing server-side exceptions.
  • No changes were required in the ORM query calls (transform_api.py or dbtautomation_service.py) as Django's UUIDField natively accepts uuid.UUID objects directly, eliminating the need for explicit str() conversions.

Fixes DALGO-BACKEND-26F

@sentry
Copy link
Copy Markdown
Author

sentry Bot commented May 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.66%. Comparing base (75cb6fd) to head (4affa18).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1373   +/-   ##
=======================================
  Coverage   58.66%   58.66%           
=======================================
  Files         132      132           
  Lines       15690    15690           
=======================================
  Hits         9205     9205           
  Misses       6485     6485           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants