File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 13
13
"""
14
14
15
15
from datetime import datetime
16
- from collections import OrderedDict
16
+ try :
17
+ from collections import OrderedDict
18
+ except ImportError :
19
+ from ordereddict import OrderedDict
17
20
from copy import deepcopy
18
21
import cPickle
19
22
from glob import glob
@@ -1844,8 +1847,8 @@ def _add_join_item_fields(self):
1844
1847
"""
1845
1848
# create the new join item fields
1846
1849
idx = self ._next_slot_index
1847
- newfields = { field : self ._add_join_item_field (field , idx )
1848
- for field in self .joinfield }
1850
+ newfields = dict ([( field , self ._add_join_item_field (field , idx ) )
1851
+ for field in self .joinfield ])
1849
1852
# increment the join slot index
1850
1853
logger .debug ("Added the %s join item fields %s." % (self , newfields ))
1851
1854
self ._next_slot_index += 1
Original file line number Diff line number Diff line change @@ -634,8 +634,8 @@ def generate_expanded_graph(graph_in):
634
634
# The itersource iterables is a {field: lookup} dictionary, where the
635
635
# lookup is a {source key: iteration list} dictionary. Look up the
636
636
# current iterable value using the predecessor itersource input values.
637
- iter_dict = { field : lookup [key ] for field , lookup in inode . iterables
638
- if key in lookup }
637
+ iter_dict = dict ([( field , lookup [key ]) for field , lookup in
638
+ inode . iterables if key in lookup ])
639
639
# convert the iterables to the standard {field: function} format
640
640
iter_items = map (lambda (field , value ): (field , lambda : value ),
641
641
iter_dict .iteritems ())
@@ -846,7 +846,7 @@ def _transpose_iterables(fields, values):
846
846
Otherwise, the result is a list of (field: value list) pairs.
847
847
"""
848
848
if isinstance (values , dict ):
849
- transposed = { field : defaultdict (list ) for field in fields }
849
+ transposed = dict ([( field , defaultdict (list )) for field in fields ])
850
850
for key , tuples in values .iteritems ():
851
851
for kvals in tuples :
852
852
for idx , val in enumerate (kvals ):
You can’t perform that action at this time.
0 commit comments