-
Notifications
You must be signed in to change notification settings - Fork 12
rcv: Refactor and extend parsing for "Otros Impuestos" field #913
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: Refactor and extend parsing for "Otros Impuestos" field #913
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 refactors the handling of "Otros Impuestos" fields in RCV CSV parsing by consolidating three separate fields into a unified structure. The change addresses cases where multiple CSV rows with empty fields represent additional tax information linked to the same invoice folio.
- Replaced individual
codigo_otro_impuesto,valor_otro_impuesto, andtasa_otro_impuestofields with a unifiedotros_impuestoslist structure - Updated CSV parsing logic to group rows by folio and aggregate "Otros Impuestos" data from additional rows
- Modified data models and schemas to support the new structure with proper type definitions
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/tests/test_rcv_parse_csv.py |
Updated test cases to use new otros_impuestos structure and added test for handling empty impuestos rows |
src/tests/test_data_models.py |
Updated test fixtures to use new otros_impuestos field instead of individual fields |
src/tests/test_data/sii-rcv/RCV-venta-extra-empty-impuestos-rows.csv |
New test data file with multiple rows for testing folio grouping functionality |
src/tests/test_data/sii-rcv/RCV-compra-reclamado.csv |
Updated test data to include "Otros Impuestos" values in the first row |
src/cl_sii/rcv/parse_csv.py |
Refactored schema definitions and parsing logic to handle grouped "Otros Impuestos" data |
src/cl_sii/rcv/data_models.py |
Updated data models with new OtrosImpuestos TypedDict and replaced individual fields |
src/cl_sii/libs/rows_processing.py |
Added folio grouping logic to aggregate "Otros Impuestos" data from multiple CSV rows |
Comments suppressed due to low confidence (2)
src/cl_sii/rcv/parse_csv.py:1
- The
Decimalimport is removed but still appears to be used in the code. Verify that all usages have been replaced or that the import is still needed.
"""
src/cl_sii/rcv/parse_csv.py:1003
- The
receptor_rutfield definition appears to be removed but this may break the schema functionality. Ensure this removal is intentional and doesn't affect CSV parsing.
receptor_rut = mm_fields.RutField(
required=True,
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #913 +/- ##
===========================================
- Coverage 89.40% 88.90% -0.50%
===========================================
Files 40 40
Lines 3728 3759 +31
Branches 378 389 +11
===========================================
+ Hits 3333 3342 +9
- Misses 243 265 +22
Partials 152 152 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4c80325 to
19f5854
Compare
19f5854 to
724f5df
Compare
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
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/cl_sii/rcv/parse_csv.py:1005
- The
receptor_rutfield definition appears to be removed fromRcvCompraCsvRowSchemabut this field is likely still needed for the schema to function properly. This could cause validation errors when processing CSV files.
receptor_rut = mm_fields.RutField(
required=True,
)
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
724f5df to
1de3daf
Compare
- This change addresses cases where multiple CSV rows with empty fields appeared, representing additional impuestos linked to the same folio as the main row. - Replaced individual fields (`codigo_otro_impuesto`, `valor_otro_impuesto`, `tasa_otro_impuesto`) with unified `otros_impuestos` structure. - Updated schemas, data models, and deserializers to handle "Otros Impuestos". - Adjusted tests and test data to validate new structure and edge cases. Ref: https://app.shortcut.com/cordada/story/16788/
1de3daf to
839a2d4
Compare
|
|
@jtrobles-cdd The PR is been blocked by coverage, could we merge it? |


codigo_otro_impuesto,valor_otro_impuesto,tasa_otro_impuesto) with unifiedotros_impuestosstructure.Ref: https://app.shortcut.com/cordada/story/16788/