Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strip extra space for column name #210

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading