add tags field
This commit is contained in:
parent
78eba472f8
commit
fb425f4157
@ -3,7 +3,6 @@ from ops.mmysql import MysqlBase
|
||||
from ops.plog import define_logger
|
||||
import logging
|
||||
import datetime
|
||||
from collections import defaultdict
|
||||
import pdb
|
||||
define_logger("/data/logs/ops/split_tags.log")
|
||||
log = logging.getLogger(__name__)
|
||||
@ -21,8 +20,7 @@ class SplitTapTags:
|
||||
def run(self):
|
||||
all = dict()
|
||||
for types in self.type:
|
||||
pdb.set_trace()
|
||||
all[types] = defaultdict[dict]
|
||||
all[types] = {}
|
||||
sql = f"""select
|
||||
tags
|
||||
from
|
||||
@ -36,7 +34,7 @@ class SplitTapTags:
|
||||
if line:
|
||||
try:
|
||||
for item in line[0].split(","):
|
||||
all[types][item] = all[types].get('item', 0) + 1
|
||||
all[types][item] = all[types].get(item, 0) + 1
|
||||
except Exception:
|
||||
log.error(f"split {line} failed!", exc_info=True)
|
||||
print(all)
|
||||
|
Loading…
x
Reference in New Issue
Block a user