I found the following issues with flatten_preserve_lists
-
flatten_preserve_lists({'K': ['abc', [1, 2, 3]]}, separator="+") results in the error re.error: nothing to repeat at position 1
-
flatten_preserve_lists({'K': ['abc', [1, 2, 3]]}, separator="=+") (note that the 'separator' is '=+' and not '+' as in the previous case)
- output:
[{'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 'abc'}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 1}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 2}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 3}]
- expected:
{'K': ['abc', [1, 2, 3]]} as the input is not nested
flatten_preserve_lists({'K': ['abc', [[1, 2, 3]]]}, separator="=+")
- output:
[{'K=+0=+1=+0=+0=+1': None, 'K=+0=+1=+0=+0=+1=+2': None, 'K=+0=+1=+0=+0': None, 'K=+0': None, 'K': 'abc'}, {'K=+0=+1=+0=+0=+1': None, 'K=+0=+1=+0=+0=+1=+2': None, 'K=+0=+1=+0=+0': None, 'K=+0': None, 'K': [1, 2, 3]}]
- expected:
{'K': ['abc', [[1, 2, 3]]]} as the input is not nested
flatten_preserve_lists({'K': ['abc', [1, 2, 3]]})
- output:
[{'K': 'abc'}, {'K': 1}, {'K': 2}, {'K': 3}]
- expected:
{'K': ['abc', [1, 2, 3]]} as the input is not nested
flatten_preserve_lists({'K': ['abc', [[1, 2, 3]]]})
- output:
[{'K': 'abc'}, {'K': [1, 2, 3]}]
- expected:
{'K': ['abc', [1, 2, 3]]} as the input is not nested
I am working with the latest version of flatten_json, which is currently 0.1.13
I found the following issues with flatten_preserve_lists
flatten_preserve_lists({'K': ['abc', [1, 2, 3]]}, separator="+")results in the errorre.error: nothing to repeat at position 1flatten_preserve_lists({'K': ['abc', [1, 2, 3]]}, separator="=+")(note that the 'separator' is '=+' and not '+' as in the previous case)[{'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 'abc'}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 1}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 2}, {'K=+0=+1=+0=+1=+2': None, 'K=+0=+1=+0=+1': None, 'K=+0=+1=+0': None, 'K=+0': None, 'K': 3}]{'K': ['abc', [1, 2, 3]]}as the input is not nestedflatten_preserve_lists({'K': ['abc', [[1, 2, 3]]]}, separator="=+")[{'K=+0=+1=+0=+0=+1': None, 'K=+0=+1=+0=+0=+1=+2': None, 'K=+0=+1=+0=+0': None, 'K=+0': None, 'K': 'abc'}, {'K=+0=+1=+0=+0=+1': None, 'K=+0=+1=+0=+0=+1=+2': None, 'K=+0=+1=+0=+0': None, 'K=+0': None, 'K': [1, 2, 3]}]{'K': ['abc', [[1, 2, 3]]]}as the input is not nestedflatten_preserve_lists({'K': ['abc', [1, 2, 3]]})[{'K': 'abc'}, {'K': 1}, {'K': 2}, {'K': 3}]{'K': ['abc', [1, 2, 3]]}as the input is not nestedflatten_preserve_lists({'K': ['abc', [[1, 2, 3]]]})[{'K': 'abc'}, {'K': [1, 2, 3]}]{'K': ['abc', [1, 2, 3]]}as the input is not nestedI am working with the latest version of flatten_json, which is currently 0.1.13