Skip to content

Commit 3811ff7

Browse files
committed
Fix ops-learning/organization-type csv output
1 parent 6f1b4d7 commit 3811ff7

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
File renamed without changes.

per/custom_renderers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ def render(self, data, *args, **kwargs):
2323
else:
2424
# we have a collections.OrderedDict (from a wide-scope query)
2525
data = data.get(self.results_field, [])
26+
if data and "organization" not in data[0]:
27+
# e.g. ops-learning/organization-type or other tricky subquery of ops-learning:
28+
data2 = [",".join(str(v) for v in data[0].keys()) + "\n"]
29+
for i, d in enumerate(data):
30+
data2.append(",".join(str(v) for v in d.values()) + "\n")
31+
return data2
2632
data2 = []
2733
for i, d in enumerate(data):
2834
for orgn in d["organization"].split(SEP):

0 commit comments

Comments
 (0)