Skip to content

Commit

Permalink
Fix For Failing tox
Browse files Browse the repository at this point in the history
  • Loading branch information
fahadsiddiqui committed Sep 21, 2020
1 parent a9a1a90 commit 1419d63
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions petl/io/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,16 @@ def fromjson(source, *args, **kwargs):
| 'c' | 2 |
+-----+-----+
Setting argument `lines` to `True` will enable :func:`etl.fromjson` to
Setting argument `lines` to `True` will enable to
infer the document as a JSON lines document. For more details about JSON lines
please visit https://jsonlines.org/.
>>> import petl as etl
>>> data_with_jlines = '''
... {"name": "Gilbert", "wins": [["straight", "7♣"], ["one pair", "10♥"]]}
... {"name": "Alexa", "wins": [["two pair", "4♠"], ["two pair", "9♠"]]}
... {"name": "Gilbert", "wins": [["straight", "7S"], ["one pair", "10H"]]}
... {"name": "Alexa", "wins": [["two pair", "4S"], ["two pair", "9S"]]}
... {"name": "May", "wins": []}
... {"name": "Deloise", "wins": [["three of a kind", "5♣"]]}
... {"name": "Deloise", "wins": [["three of a kind", "5S"]]}
... '''
>>> with open('example.json', 'w') as f:
... f.write(data_with_jlines)
Expand All @@ -61,13 +61,13 @@ def fromjson(source, *args, **kwargs):
+---------+-------------------------------------------+
| name | wins |
+=========+===========================================+
| Gilbert | [['straight', '7♣'], ['one pair', '10♥']] |
| Gilbert | [['straight', '7S'], ['one pair', '10H']] |
+---------+-------------------------------------------+
| Alexa | [['two pair', '4♠'], ['two pair', '9♠']] |
| Alexa | [['two pair', '4S'], ['two pair', '9S']] |
+---------+-------------------------------------------+
| May | [] |
+---------+-------------------------------------------+
| Deloise | [['three of a kind', '5♣']] |
| Deloise | [['three of a kind', '5S']] |
+---------+-------------------------------------------+
If your JSON file does not fit this structure, you will need to parse it
Expand Down

0 comments on commit 1419d63

Please sign in to comment.