fixbug
This commit is contained in:
parent
30c249f1fe
commit
9ce2ba817e
@ -553,7 +553,6 @@ class TapWeeklyReport:
|
|||||||
return r_data, new_tags
|
return r_data, new_tags
|
||||||
|
|
||||||
def collect_tags(self, data):
|
def collect_tags(self, data):
|
||||||
|
|
||||||
row_tags = dict()
|
row_tags = dict()
|
||||||
for line in data:
|
for line in data:
|
||||||
try:
|
try:
|
||||||
@ -564,7 +563,18 @@ class TapWeeklyReport:
|
|||||||
row_tags[data_type][tag] = row_tags[data_type].get(tag, 0) + 1
|
row_tags[data_type][tag] = row_tags[data_type].get(tag, 0) + 1
|
||||||
except Exception:
|
except Exception:
|
||||||
log.error(f"collect tags failed with {line}", exc_info=True)
|
log.error(f"collect tags failed with {line}", exc_info=True)
|
||||||
return row_tags
|
new_data = {}
|
||||||
|
if row_tags:
|
||||||
|
new_tags = sorted(row_tags.items(), key=lambda d: d[1])
|
||||||
|
pdb.set_trace()
|
||||||
|
for key in new_tags:
|
||||||
|
new_data[key] = list()
|
||||||
|
for i in range(0, 3):
|
||||||
|
temp = {}
|
||||||
|
temp[new_tags[key].keys()[i]] = new_tags[new_tags[key].keys()[i]]
|
||||||
|
new_data[key].append(temp)
|
||||||
|
|
||||||
|
return new_data
|
||||||
|
|
||||||
def build(self):
|
def build(self):
|
||||||
# weekly_day = json.dumps(self.get_weekly_days()).strip('[]')
|
# weekly_day = json.dumps(self.get_weekly_days()).strip('[]')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user