0001-convert-enumerate-generator-into-list-before-checkin.patch
wcs_olap/feeder.py | ||
---|---|---|
392 | 392 |
ids = range(next_id, next_id + len(to_insert)) |
393 | 393 |
labels = zip(ids, to_insert) |
394 | 394 | |
395 |
if labels: |
|
395 |
if labels is not None: |
|
396 |
# turn enumerate generator object into a proper list |
|
396 | 397 |
labels = list(labels) |
398 | ||
399 |
if labels: |
|
397 | 400 |
tmpl = ', '.join(['(%s, %s)'] * len(labels)) |
398 | 401 |
query_str = 'INSERT INTO {name} (id, label) VALUES %s' % tmpl |
399 | 402 |
self.ex(query_str, ctx={'name': name}, vars=list(itertools.chain(*labels))) |
400 |
- |