We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 88941ad commit 5faa4ecCopy full SHA for 5faa4ec
rest_pandas/renderers.py
@@ -98,7 +98,7 @@ class PandasJSONRenderer(PandasBaseRenderer):
98
99
def get_pandas_kwargs(self, data):
100
return {
101
- 'orient': 'index',
+ 'orient': 'records',
102
'date_format': 'iso',
103
}
104
tests/test_views.py
@@ -26,8 +26,8 @@ def test_view_json(self):
26
response = self.client.get("/timeseries.json")
27
self.assertEqual(response.accepted_media_type, "application/json")
28
data = json.loads(response.content.decode('utf-8'))
29
- self.assertEqual(len(data.keys()), 5)
30
- self.assertEqual(data["1"]["value"], 0.5)
+ self.assertEqual(len(data), 5)
+ self.assertEqual(data[0]["value"], 0.5)
31
32
def test_viewset(self):
33
response = self.client.get("/router/timeseries/.csv")
0 commit comments