fix: 修复QA文件解析失败 (#933)

(cherry picked from commit b3c7120372)
This commit is contained in:
shaohuzhang1 2024-08-06 14:47:28 +08:00 committed by shaohuzhang1
parent cb9bbccd4a
commit 1117814a08
2 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ def handle_sheet(file_name, sheet):
problem_list = [{'content': p[0:255]} for p in problem.split('\n') if len(p.strip()) > 0]
title = get_row_value(row, title_row_index_dict, 'title')
title = str(title) if title is not None else ''
content = str(content)
paragraph_list.append({'title': title[0:255],
'content': content[0:4096],
'problem_list': problem_list})

View File

@ -33,7 +33,7 @@ def handle_sheet(file_name, sheet):
problem_list = [{'content': p[0:255]} for p in problem.split('\n') if len(p.strip()) > 0]
title = get_row_value(row, title_row_index_dict, 'title')
title = str(title.value) if title is not None and title.value is not None else ''
content = content.value
content = str(content.value)
paragraph_list.append({'title': title[0:255],
'content': content[0:4096],
'problem_list': problem_list})