Skip to content

fixed null handling for pos, parent_load_id and loan_type#310

Open
thomastomy5 wants to merge 4 commits into
developfrom
fix/nullfix
Open

fixed null handling for pos, parent_load_id and loan_type#310
thomastomy5 wants to merge 4 commits into
developfrom
fix/nullfix

Conversation

@thomastomy5

@thomastomy5 thomastomy5 commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of image metadata when loan-related fields are missing, allowing clients to submit partial/blank values without validation errors.
    • Made metadata parsing more tolerant of nullable loan type, position, and parent-loan details.
  • Other
    • Added stricter validation for loan_id in ad-hoc image uploads to reject blank/whitespace values.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 785e2169-d96d-422c-aa70-4d1fa76e7253

📥 Commits

Reviewing files that changed from the base of the PR and between 52f0357 and 339c87e.

📒 Files selected for processing (1)
  • wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py

📝 Walkthrough

Walkthrough

gold_image_request.py now uses Optional[...] annotations for several request fields, makes ImageMetadata.loan_id required, and adds blank-string validation for AdhocImageUploadRequest.loan_id.

Changes

Gold image request model updates

Layer / File(s) Summary
Nullable Item fields
wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py
Optional is imported, and Item scalar fields are annotated as nullable while keeping None defaults.
ImageMetadata annotations and loan_id requirement
wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py
ImageMetadata fields are broadened to Optional[...] where applicable, and loan_id changes from a nullable default to a required string.
loan_id validators
wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py
ImageMetadata retains its blank-check validator, and AdhocImageUploadRequest adds a blank-check validator for loan_id.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • rootflo/wavefront#205: Both PRs touch wavefront/.../gold_image_request.py’s Item model and related weight field typing.
  • rootflo/wavefront#303: Adds and validates the same loan_type, pos, and parent_loan_id fields in gold_image_request.py.

Suggested reviewers: vizsatiz, vishnurk6247

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main fix: null handling for pos and loan_type, and it’s clearly related despite the minor field-name typo.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/nullfix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py`:
- Around line 37-39: The model annotations in gold_image_request.py use Optional
in the request fields, but the module only imports List and Literal, so it will
fail to load with a NameError. Update the typing imports at the top of the file
to include Optional, keeping the existing GoldImageRequest fields like
loan_type, pos, and parent_loan_id unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c263d6ce-cf22-4dbe-ac61-542ce6b08fe5

📥 Commits

Reviewing files that changed from the base of the PR and between 21e191d and fc2e054.

📒 Files selected for processing (1)
  • wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py

Comment thread wavefront/server/modules/gold_module/gold_module/models/gold_image_request.py Outdated
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.

2 participants