Skip to content

Commit

Permalink
Merge pull request #210 from mutantsan/fix-col-header-strip
Browse files Browse the repository at this point in the history
strip extra space for column name
  • Loading branch information
wardi authored Mar 12, 2024
2 parents 67fabfc + c066de9 commit 95edb97
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ckanext/xloader/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ def load_csv(csv_filepath, resource_id, mimetype='text/csv', logger=None):
logger.warning('Could not determine delimiter from file, use default ","')
delimiter = ','

headers = [header.strip()[:MAX_COLUMN_LENGTH] for header in headers if header.strip()]
headers = [
header.strip()[:MAX_COLUMN_LENGTH].strip()
for header in headers
if header.strip()
]

# TODO worry about csv header name problems
# e.g. duplicate names
Expand Down

0 comments on commit 95edb97

Please sign in to comment.