Conversation
WalkthroughAdds a new public field Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Changes are additive and localized: one model field plus an import and a single-line version bump. Low logic density and small file spread. Possibly related issues
Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #433 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 54 54
Lines 1185 1186 +1
=========================================
+ Hits 1185 1186 +1
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:
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cuenca/resources/kyc_validations.py (1)
25-39: Add thestatusfield to the example.The
json_schema_extraexample is missing the newly addedstatusfield, which creates inconsistency between the model definition and its documentation.Apply this diff to include the
statusfield in the example:json_schema_extra={ 'example': { 'id': 'KVNEUInh69SuKXXmK95sROwQ', 'created_at': '2020-05-24T14:15:22Z', 'platform_id': 'PT-1234567890', 'user_id': 'US-1234567890', 'source_type': 'server', 'flow_id': '123e4567-e89b-12d3-a456-426614174000', + 'status': 'pending', 'files_uri': ['cuenca.com/files/id', 'cuenca.com/files/id2'], 'verification_id': 'metamap-verification-id', 'identity_id': 'metamap-identity-id', } }Note: Replace
'pending'with an appropriate example value from theKYCValidationStatusenum once the import issue is resolved.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cuenca/resources/kyc_validations.py(2 hunks)cuenca/version.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
⚙️ CodeRabbit configuration file
**/*.py: Enforce Relative Imports for Internal ModulesEnsure that any imports referencing internal modules use relative paths. However, if modules reside in the main module directories (for example /src or /library_or_app_name) —and relative imports are not feasible—absolute imports are acceptable. Additionally, if a module is located outside the main module structure (for example, in /tests or /scripts at a similar level), absolute imports are also valid.
Examples and Guidelines:
- If a module is in the same folder or a subfolder of the current file, use relative imports. For instance: from .some_module import SomeClass
- If the module is located under /src or /library_or_app_name and cannot be imported relatively, absolute imports are allowed (e.g., from library_or_app_name.utilities import helper_method).
- If a module is outside the main module directories (for example, in /tests, /scripts, or any similarly placed directory), absolute imports are valid.
- External (third-party) libraries should be imported absolutely (e.g., import requests).
**/*.py:
Rule: Enforce Snake Case in Python Backend
- New or Modified Code: Use snake_case for all variables, functions, methods, and class attributes.
- Exceptions (Pydantic models for API responses):
- Primary fields must be snake_case.
- If older clients expect camelCase, create a computed or alias field that references the snake_case field.
- Mark any camelCase fields as deprecated or transitional.
Examples
Invalid:
class CardConfiguration(BaseModel): title: str subTitle: str # ❌ Modified or new field in camelCaseValid:
class CardConfiguration(BaseModel): title: str subtitle: str # ✅ snake_case for new/modified field @computed_field def subTitle(self) -> str: # camelCase allowed only for compatibility return self.subtitleAny direct use of camelCase in new or updated code outside of these exceptions should be flagged.
`*...
Files:
cuenca/version.pycuenca/resources/kyc_validations.py
🪛 GitHub Actions: test
cuenca/resources/kyc_validations.py
[error] 3-3: ImportError: cannot import name 'KYCValidationStatus' from 'cuenca_validations.types'.
🔇 Additional comments (2)
cuenca/resources/kyc_validations.py (1)
20-20: Approve the field addition.The
statusfield declaration follows proper snake_case naming conventions and uses the appropriate type annotation.cuenca/version.py (1)
1-1: LGTM! Standard version bump.The version update to
2.1.14.dev0follows standard semantic versioning for development releases.
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cuenca/resources/kyc_validations.py (1)
27-37: Critical: Example dict is missing the newstatusfield.The example in
json_schema_extramust include the newly addedstatusfield to accurately reflect the model structure. This ensures that API documentation and developer examples are complete.Apply this diff to add the
statusfield to the example:json_schema_extra={ 'example': { 'id': 'KVNEUInh69SuKXXmK95sROwQ', 'created_at': '2020-05-24T14:15:22Z', 'platform_id': 'PT-1234567890', 'user_id': 'US-1234567890', 'source_type': 'server', 'flow_id': '123e4567-e89b-12d3-a456-426614174000', + 'status': 'created', 'files_uri': ['cuenca.com/files/id', 'cuenca.com/files/id2'], 'verification_id': 'metamap-verification-id', 'identity_id': 'metamap-identity-id', } }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
cuenca/resources/kyc_validations.py(2 hunks)cuenca/version.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
⚙️ CodeRabbit configuration file
**/*.py: Enforce Relative Imports for Internal ModulesEnsure that any imports referencing internal modules use relative paths. However, if modules reside in the main module directories (for example /src or /library_or_app_name) —and relative imports are not feasible—absolute imports are acceptable. Additionally, if a module is located outside the main module structure (for example, in /tests or /scripts at a similar level), absolute imports are also valid.
Examples and Guidelines:
- If a module is in the same folder or a subfolder of the current file, use relative imports. For instance: from .some_module import SomeClass
- If the module is located under /src or /library_or_app_name and cannot be imported relatively, absolute imports are allowed (e.g., from library_or_app_name.utilities import helper_method).
- If a module is outside the main module directories (for example, in /tests, /scripts, or any similarly placed directory), absolute imports are valid.
- External (third-party) libraries should be imported absolutely (e.g., import requests).
**/*.py:
Rule: Enforce Snake Case in Python Backend
- New or Modified Code: Use snake_case for all variables, functions, methods, and class attributes.
- Exceptions (Pydantic models for API responses):
- Primary fields must be snake_case.
- If older clients expect camelCase, create a computed or alias field that references the snake_case field.
- Mark any camelCase fields as deprecated or transitional.
Examples
Invalid:
class CardConfiguration(BaseModel): title: str subTitle: str # ❌ Modified or new field in camelCaseValid:
class CardConfiguration(BaseModel): title: str subtitle: str # ✅ snake_case for new/modified field @computed_field def subTitle(self) -> str: # camelCase allowed only for compatibility return self.subtitleAny direct use of camelCase in new or updated code outside of these exceptions should be flagged.
`*...
Files:
cuenca/version.pycuenca/resources/kyc_validations.py
🔇 Additional comments (2)
cuenca/version.py (1)
1-1: LGTM! Version bump is appropriate.The version increment from '2.1.13' to '2.1.14' correctly reflects the addition of the new
statusfield to theKYCValidationmodel.cuenca/resources/kyc_validations.py (1)
20-20: LGTM! Status field follows best practices.The field declaration follows proper Pydantic syntax with snake_case naming and an appropriate default value.
Summary by CodeRabbit
New Features
Chores