Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #894 from openedx/hassan/fix-cwsm-export
Browse files Browse the repository at this point in the history
fix: skip rows where columns exceed field size limit.
  • Loading branch information
HassanJaveed84 authored Feb 7, 2024
2 parents fd025d6 + b908830 commit 4dd22f5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion edx/analytics/tasks/export/database_exports.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@ def mapper(self, line):
key: course_id
value: tab separated row data
"""
values = csv_util.parse_line(line, dialect='mysqldump')
try:
values = csv_util.parse_line(line, dialect='mysqldump')
except csv.Error as e:
if 'field larger than field limit' in e.message:
log.error('Field larger than field limit in line: %s', line)
return
else:
log.error('Error parsing line: %s', line)
raise

record = StudentModuleRecord(*values)

course_id = record.course_id
Expand Down

0 comments on commit 4dd22f5

Please sign in to comment.