fix: 移除干扰来源字段
This commit is contained in:
@@ -143,11 +143,9 @@ EXPECTED_HEADERS = {
|
||||
SUMMARY_HEADER = (
|
||||
"hour_start",
|
||||
"hour_end",
|
||||
"source_type",
|
||||
"cgi",
|
||||
"cell_name",
|
||||
"interference_dbm",
|
||||
"source_path",
|
||||
)
|
||||
|
||||
class ProcessingError(RuntimeError):
|
||||
@@ -193,12 +191,10 @@ class MySQLSummaryStore:
|
||||
f"""
|
||||
CREATE TABLE IF NOT EXISTS {table} (
|
||||
metric_time DATETIME NOT NULL COMMENT '指标开始时间',
|
||||
source_type VARCHAR(64) NOT NULL,
|
||||
cgi VARCHAR(128) NOT NULL,
|
||||
cell_name VARCHAR(255) NOT NULL,
|
||||
interference_dbm DECIMAL(10,3) NOT NULL,
|
||||
source_path VARCHAR(1024) NOT NULL,
|
||||
PRIMARY KEY (metric_time, source_type, cgi)
|
||||
PRIMARY KEY (metric_time, cgi)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
"""
|
||||
)
|
||||
@@ -218,17 +214,15 @@ class MySQLSummaryStore:
|
||||
cursor.executemany(
|
||||
f"""
|
||||
INSERT INTO {table}
|
||||
(metric_time, source_type, cgi, cell_name, interference_dbm, source_path)
|
||||
VALUES (%s, %s, %s, %s, %s, %s)
|
||||
(metric_time, cgi, cell_name, interference_dbm)
|
||||
VALUES (%s, %s, %s, %s)
|
||||
""",
|
||||
[
|
||||
(
|
||||
metric_time,
|
||||
row["source_type"],
|
||||
row["cgi"],
|
||||
row["cell_name"],
|
||||
row["interference_dbm"],
|
||||
row["source_path"],
|
||||
)
|
||||
for row in rows
|
||||
],
|
||||
@@ -479,8 +473,6 @@ def process(
|
||||
summary_rows.append(summary_record(record, source_type, candidate.path, window, row_number))
|
||||
manifest_files.append(
|
||||
{
|
||||
"source_type": source_type,
|
||||
"source_path": candidate.path,
|
||||
"source_size": candidate.size,
|
||||
"sha256": hashlib.sha256(raw_zip).hexdigest(),
|
||||
"xlsx_member": member_name,
|
||||
@@ -489,7 +481,7 @@ def process(
|
||||
}
|
||||
)
|
||||
|
||||
summary_rows.sort(key=lambda item: (EXPECTED_TYPES.index(item["source_type"]), item["cgi"], item["cell_name"]))
|
||||
summary_rows.sort(key=lambda item: (item["cgi"], item["cell_name"]))
|
||||
summary_name = f"interference_summary_{window}.csv"
|
||||
write_dict_csv(temp_dir / summary_name, SUMMARY_HEADER, summary_rows)
|
||||
if store is not None:
|
||||
@@ -499,7 +491,6 @@ def process(
|
||||
"window": window,
|
||||
"hour_start": window_bounds(window)[0],
|
||||
"hour_end": window_bounds(window)[1],
|
||||
"source_types": list(EXPECTED_TYPES),
|
||||
"source_file_count": len(manifest_files),
|
||||
"summary_rows": len(summary_rows),
|
||||
"warnings": warnings_out,
|
||||
@@ -558,11 +549,9 @@ def summary_record(
|
||||
return {
|
||||
"hour_start": hour_start,
|
||||
"hour_end": hour_end,
|
||||
"source_type": source_type,
|
||||
"cgi": cgi,
|
||||
"cell_name": cell_name,
|
||||
"interference_dbm": interference,
|
||||
"source_path": source_path,
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user