Conversation
WalkthroughThis pull request renames the public field Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cuenca_validations/types/requests.py (1)
107-108:⚠️ Potential issue | 🟠 MajorAdd
validation_aliasto accept bothis_dormantandis_inactivefor backward compatibility.
UserUpdateRequestinheritsextra="forbid"fromBaseRequest, so this rename will reject existing payloads sendingis_inactive. Use Pydantic'svalidation_aliaswithAliasChoicesto accept both field names during deserialization while serializing onlyis_dormant.♻️ Suggested compatibility shim
from pydantic import ( + AliasChoices, BaseModel, ConfigDict, EmailStr, Field,- is_dormant: Optional[bool] = None + is_dormant: Optional[bool] = Field( + default=None, + validation_alias=AliasChoices('is_dormant', 'is_inactive'), + )🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cuenca_validations/types/requests.py` around lines 107 - 108, BaseRequest currently forbids unknown fields so renamed fields like is_dormant break existing payloads using is_inactive; add a validation alias mapping so deserialization accepts the old name while serialization keeps is_dormant. Update BaseRequest.model_config (ConfigDict) to include validation_alias using AliasChoices mapping is_dormant -> ["is_inactive"] (so UserUpdateRequest and other subclasses accept either input name) and keep extra="forbid". Reference BaseRequest, model_config, ConfigDict, validation_alias and AliasChoices when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@cuenca_validations/types/requests.py`:
- Around line 107-108: BaseRequest currently forbids unknown fields so renamed
fields like is_dormant break existing payloads using is_inactive; add a
validation alias mapping so deserialization accepts the old name while
serialization keeps is_dormant. Update BaseRequest.model_config (ConfigDict) to
include validation_alias using AliasChoices mapping is_dormant ->
["is_inactive"] (so UserUpdateRequest and other subclasses accept either input
name) and keep extra="forbid". Reference BaseRequest, model_config, ConfigDict,
validation_alias and AliasChoices when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 0625c1c4-c868-474e-9c80-ca91424854b2
📒 Files selected for processing (2)
cuenca_validations/types/requests.pycuenca_validations/version.py
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #398 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1422 1422
=========================================
Hits 1422 1422
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Summary by CodeRabbit
Release Notes - Version 2.1.27
Breaking Changes
Version Update