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

Fixes #11929 - Strip whitespace from csv headers #11956

Conversation

kkthxbye-code
Copy link
Contributor

Fixes: #11929

Not sure if there's a better way of doing this. Both the headers and records vars contain the headers. Tests passes, but not sure if there's some weird edge cases.

@kkthxbye-code kkthxbye-code changed the title #11929 - Strip whitespace from csv headers Fixes #11929 - Strip whitespace from csv headers Mar 10, 2023
@jeremystretch
Copy link
Member

Is there any reason not to implement this a bit closer to the source, inside parse_csv()? That way we'd only need to clean the headers once.

@jeremystretch
Copy link
Member

I moved the calls to strip() under parse_csv() and it seems to work without issue.

@jeremystretch jeremystretch merged commit e459c46 into netbox-community:develop Mar 13, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove whitespace on header columns for CSV import
2 participants