-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: Make conform_record_data_types
work on nested objects and arrays
#887
fix: Make conform_record_data_types
work on nested objects and arrays
#887
Conversation
Codecov Report
@@ Coverage Diff @@
## main #887 +/- ##
==========================================
+ Coverage 83.85% 84.53% +0.67%
==========================================
Files 44 44
Lines 4151 4189 +38
Branches 718 725 +7
==========================================
+ Hits 3481 3541 +60
+ Misses 490 474 -16
+ Partials 180 174 -6
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@Jack-Burnett - Thanks very much for this contribution! @edgarrmondragon is primary reviewer for this. Since this is a non-trivial change, it may require a few days and up to a week for review and discussion. @edgarrmondragon - Let me know if I can assist in any way. |
Hey @edgarrmondragon, I saw you approved this but didn't merge it - just wanted to check if you wanted any changes, or is it still being reviewed? No worries either way |
conform_record_data_types
work on nested objects and arrays
Also document the field.
254735c
to
69f0b18
Compare
Closes #800
conform_record_data_types is responsible for converting values into json-legal form and removing fields that are not in the catalog.
Previously conform_record_data_types only worked on primitive fields on the given record.
This PR expands it to also work on lists of primitives, nested objects, and lists of objects.
Since the options available for a list are pretty wide in jsonschema, this PR only addresses lists of uniform type (e.g. a single schema applies to the whole list, as opposed to different schemas for different indices), as this is the most common type in my experience.
When logging a list of fields it has removed, it will log them with their path, e.g. "base_obect_name.child_object.primitive_value".