You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
821 B
14 lines
821 B
# -*- coding: utf-8 -*-
|
|
"""diag-manual-fail.py — 查手工复核任务的失败明细原因(实锤缺省列)"""
|
|
import io, sys, pymysql
|
|
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
|
|
|
|
conn = pymysql.connect(host='8.129.84.155', port=3306, user='root', password='Itc@123456',
|
|
database='crm', charset='utf8mb4', autocommit=True,
|
|
connect_timeout=10, cursorclass=pymysql.cursors.DictCursor)
|
|
with conn.cursor() as cur:
|
|
cur.execute("SELECT row_num, fail_reason, CHAR_LENGTH(fail_reason) len "
|
|
"FROM customer_import_fail WHERE task_id=%s ORDER BY id", (751743926301360128,))
|
|
for r in cur.fetchall():
|
|
print(f"row={r['row_num']} len={r['len']}")
|
|
print(' reason:', (r['fail_reason'] or '')[:300].replace('\n', ' | '))
|
|
|