BUG: Raise a TypeError when record_path doesn't point to an array #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When
record_path
will points to something that is Iterable but is nota sequence in JSON world we will receive odd results.
Based on RFC 8259 (https://tools.ietf.org/html/rfc8259) a JSON value MUST be an
object, array, number, or string, false, null, true. But only two of
they should be treated as Iterable.
Based on that
[{'key':'value'}]
and{'key':'value'}
should not betreated in the same way. In
json_normalize
documentationrecord_path
is described as
Path in each object to list of records
.So when we want to translate JSON to python like an object we need to take
into consideration list (sequence). Based on that
record_path
shouldpoint out to
list
, notIterable
.In specs I added all possibile values that are allowed in JSON and
should not be treated as collection. There is a special case for null
value that is already implemented.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff