Trying to flatten more than a 2-level nested list fails.
Version: 0.27.0
Steps to reproduce
Create example.json file containing a 3-level nested list:
{
"main": [
{
"nested_list": [
[
["a", "b"],
["c", "d"]
]
]
}
]
}
Try to flatten:
flatten-tool flatten example.json
Result:
<class 'collections.OrderedDict'>
<class 'list'>
[['a', 'b'], ['c', 'd']]
'list' object has no attribute 'items'
Possible solutions
- Flatten the whole list into a string, e.g.
"[[[""a"",""b""],[""c"",""d""]]]", this is what flatterer does.
- As a minimum, fail gracefully and ignore the list, allowing the rest of the process to continue.
Trying to flatten more than a 2-level nested list fails.
Version:
0.27.0Steps to reproduce
Create
example.jsonfile containing a 3-level nested list:{ "main": [ { "nested_list": [ [ ["a", "b"], ["c", "d"] ] ] } ] }Try to flatten:
Result:
Possible solutions
"[[[""a"",""b""],[""c"",""d""]]]", this is what flatterer does.