modify scripts
This commit is contained in:
@ -98,6 +98,14 @@ def fetch_reports_list_general(fetch_func, table_name, s_date, e_date, data_dir_
|
||||
except ValueError:
|
||||
row['newPeIssueA'] = 0.0
|
||||
|
||||
# 对超长的 author 和 researcher 字段进行截断,避免数据库插入失败, 最大长度为250个字符
|
||||
if 'author' in row and row['author'] is not None:
|
||||
if len(row['author']) > 250:
|
||||
row['author'] = row['author'][:250]
|
||||
if 'researcher' in row and row['researcher'] is not None:
|
||||
if len(row['researcher']) > 250:
|
||||
row['researcher'] = row['researcher'][:250]
|
||||
|
||||
row_id = db_tools.insert_or_update_common(row, table_name)
|
||||
if row_id:
|
||||
logging.debug(f'insert one row. rowid:{row_id}, ')
|
||||
|
||||
Reference in New Issue
Block a user