Skip to content

Commit

Permalink
Merge pull request pudo#190 from paulfurley/order-json-freeze-determi…
Browse files Browse the repository at this point in the history
…nistically

Order JSON freeze fields deterministically
  • Loading branch information
pudo authored Nov 21, 2016
2 parents 6fc8bfe + 866713f commit 3f0eb9a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dataset/freeze/format/fjson.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import json
from datetime import datetime, date
from collections import defaultdict
from collections import defaultdict, OrderedDict
from decimal import Decimal

from six import PY3
Expand Down Expand Up @@ -29,10 +29,10 @@ def wrap(self, result):
if self.mode == 'item':
result = result[0]
if self.export.get_bool('wrap', True):
result = {
'count': len(result),
'results': result
}
result = OrderedDict([
('count', len(result)),
('results', result),
])
meta = self.export.get('meta', {})
if meta is not None:
result['meta'] = meta
Expand Down

0 comments on commit 3f0eb9a

Please sign in to comment.