-
Notifications
You must be signed in to change notification settings - Fork 12
rcv: Make iva_no_retenido optional in data models and parsers
#891
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
rcv: Make iva_no_retenido optional in data models and parsers
#891
Conversation
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.
Pull Request Overview
This PR makes the iva_no_retenido field optional across RCV data models and CSV parsers to handle cases where this field may be missing or null in the data source.
- Made
iva_no_retenidofield optional in data models by changing type frominttoOptional[int] - Updated CSV parser functions to use
.get()method instead of direct key access foriva_no_retenido - Updated test data to use
Noneinstead of0foriva_no_retenidoto reflect the optional nature
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/cl_sii/rcv/data_models.py | Changed iva_no_retenido field type from int to Optional[int] in base data model |
| src/cl_sii/rcv/parse_csv.py | Updated CSV parser functions to handle optional iva_no_retenido field using .get() method |
| src/tests/test_rcv_data_models.py | Updated test case to use None instead of 0 for iva_no_retenido field |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #891 +/- ##
========================================
Coverage 88.97% 88.97%
========================================
Files 40 40
Lines 3565 3565
Branches 355 355
========================================
Hits 3172 3172
Misses 240 240
Partials 153 153 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Updated `iva_no_retenido` to be optional in `RcDetalleEntry` and its variants. - Adjusted CSV parser to handle cases where `iva_no_retenido` is missing or `None`. - Updated tests to reflect changes in `iva_no_retenido` handling. Ref: https://app.shortcut.com/cordada/story/16600/
448250f to
b471dfc
Compare
|



iva_no_retenidoto be optional inRcDetalleEntryand its variants.iva_no_retenidois missing orNone.iva_no_retenidohandling.Ref: https://app.shortcut.com/cordada/story/16600/