-
Notifications
You must be signed in to change notification settings - Fork 14
Fixs #423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixs #423
Conversation
|
""" WalkthroughThis change updates several components across the codebase. The Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 52 52
Lines 1151 1156 +5
=========================================
+ Hits 1151 1156 +5
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
cuenca/resources/terms_of_service.py(1 hunks)cuenca/resources/verifications.py(1 hunks)cuenca/version.py(1 hunks)requirements.txt(1 hunks)tests/resources/cassettes/test_verification_email_create.yaml(2 hunks)tests/resources/cassettes/test_verification_phone_create.yaml(2 hunks)tests/resources/test_users.py(0 hunks)tests/resources/test_verifications.py(0 hunks)
💤 Files with no reviewable changes (2)
- tests/resources/test_users.py
- tests/resources/test_verifications.py
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
Instructions used from:
Sources:
⚙️ CodeRabbit Configuration File
🪛 GitHub Actions: test
cuenca/resources/terms_of_service.py
[error] 14-14: TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' at line 14. Likely caused by use of Python 3.10+ syntax (PEP 604) in an incompatible Python version.
🔇 Additional comments (9)
requirements.txt (1)
2-2: LGTM - Dependency update aligns with API changes.The
cuenca-validationsversion update from 2.1.8 to 2.1.10 appropriately supports the API and model changes introduced in this PR.cuenca/version.py (1)
1-1: LGTM - Appropriate version bump for development release.The version update to
2.1.6.dev2properly indicates this is a development release with the API changes introduced in this PR.cuenca/resources/terms_of_service.py (1)
9-16: No remaining references to removed TermsOfService fieldsA search for
TermsOfService.is_activeorTermsOfService.uriacross the repository returned no hits outside the class definition. The breaking change is safe and no further updates are required.cuenca/resources/verifications.py (1)
37-45: Verification.create callers updated – noplatform_idusage foundAll invocations of
Verification.create()have been updated and none pass aplatform_idargument. Approving the API simplification.tests/resources/cassettes/test_verification_email_create.yaml (3)
3-3: LGTM - Test cassette properly reflects API changes.The simplified request body removing
platform_idandsenderfields correctly matches theVerification.create()method signature changes.
6-6: LGTM - Headers updated consistently.The Content-Length adjustment to '49' and User-Agent update to
cuenca-python/2.1.5are consistent with the simplified request payload and version changes.Also applies to: 10-10
17-17: LGTM - Response format updated to match newer API.The response body includes new fields like
identity_idandlanguagewhich appear to be part of the updated API format, maintaining backward compatibility with existing fields.tests/resources/cassettes/test_verification_phone_create.yaml (2)
9-10: User-Agent still shows 2.1.5 whileversion.pywas bumped to 2.1.6.dev2The cassette was re-recorded but the UA header didn’t pick up the new package version.
Please re-record (or edit) so thatcuenca-python/2.1.6.dev2is reflected; otherwise downstream assertions or analytics that rely on the version will be misleading.Likely an incorrect or invalid review comment.
17-17:platform_idstill present in the stubbed response
Verification.create()no longer acceptsplatform_id, yet the API still returns it.
Double-check that:
- The dataclass / Pydantic model still includes
platform_idas an optional field.- Tests do not assert its absence.
If the field was truly deprecated server-side, consider regenerating the cassette after it is removed to avoid confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
cuenca/resources/users_tos_agreements.py(2 hunks)cuenca/version.py(1 hunks)tests/resources/cassettes/test_user_tos_agreements_create.yaml(1 hunks)tests/resources/test_users_tos_agreements.py(1 hunks)
✅ Files skipped from review due to trivial changes (2)
- cuenca/version.py
- tests/resources/cassettes/test_user_tos_agreements_create.yaml
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py
Instructions used from:
Sources:
⚙️ CodeRabbit Configuration File
🧬 Code Graph Analysis (2)
tests/resources/test_users_tos_agreements.py (1)
cuenca/resources/users_tos_agreements.py (2)
UserTOSAgreement(14-43)create(30-43)
cuenca/resources/users_tos_agreements.py (1)
cuenca/resources/base.py (1)
_create(55-62)
🔇 Additional comments (5)
tests/resources/test_users_tos_agreements.py (2)
1-3: Import structure looks correct.The absolute imports are appropriately used since this test file is located outside the main module directories (
/tests), making absolute imports valid according to the coding guidelines.
12-12: Assertion is appropriate for testing successful creation.The assertion correctly verifies that the creation was successful by checking for a non-empty
idattribute.cuenca/resources/users_tos_agreements.py (3)
2-2: Import structure follows coding guidelines correctly.The imports properly use relative imports for internal modules (
..http) and absolute imports for external dependencies (cuenca_validations,typing).Also applies to: 5-8, 10-10
20-20: Field modifications improve clarity and flexibility.The changes appropriately:
- Rename
terms_of_servicetoterms_of_service_urifor better clarity- Make several fields optional with proper typing
- Add the new
signature_image_urlfieldThese modifications align with the API changes mentioned in the summary.
Also applies to: 24-27
29-43: Well-implemented create method with proper encapsulation.The create method:
- Uses appropriate type hints and optional parameters
- Properly uses keyword-only argument for the session parameter
- Delegates to the internal
_createmethod following the established pattern- Returns a properly typed instance
The implementation follows good practices for API design and encapsulation.
Summary by CodeRabbit
New Features
Bug Fixes
Chores