[FEATURE] When a nested field has mismatched type print the full path to that nested field
See original GitHub issueSummary
In a complex structure like the following:
{
"source_machine": {
"port": 80
},
"dest_machine": {
"port": "http-port"
}
}
If there was an error with another log where dest_machine.port
was an integer this would error and simply state something like:
Ignoring field with mismatched type: old=(hard,port,NULLABLE,STRING); new=(hard,port,NULLABLE,INTEGER)
At this point you are left to figure out which structure this port
column actually exists in. This is a more simple example but as the schema grows and is more complex, this problem is harder to manually resolve.
Ideally, we can track the path to this using a JSON path or dpath expression. Something like dest_machine.port
. This will likely take adding an additional argument to the recursive function merge_schema_entry
. Something like a base_path=None
and continually build up that base_path string in each recursive iteration so that it can be used in the errors like "{}.{}".format(base_path, new_name)
and "{}.{}".format(base_path, old_name)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
Oh, I understand your problem, you have 2
port
fields, so the line number does not help.Pushed v1.2 to PyPI.