diff --git a/taptap/tap_split_tags.py b/taptap/tap_split_tags.py index 4748367..8a9abcb 100644 --- a/taptap/tap_split_tags.py +++ b/taptap/tap_split_tags.py @@ -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)