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

FIX: Parse commas in CSV fields #3637

Conversation

zachlindsey
Copy link

@zachlindsey zachlindsey commented Mar 13, 2024

Summary

Fixes #3635

List of changes proposed in this PR (pull-request)

  • Use the csv library to parse CSV files, so that quoted fields are correctly parsed.
  • Add a delimiter field to CSVReader so that things like TSVs can be parsed.

Copy link

codecov bot commented Mar 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.14%. Comparing base (c46a957) to head (5e84919).
Report is 7 commits behind head on master.

❗ Current head 5e84919 differs from pull request most recent head f746c34. Consider uploading reports for the commit f746c34 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3637      +/-   ##
==========================================
- Coverage   63.15%   63.14%   -0.01%     
==========================================
  Files         308      308              
  Lines       40825    40824       -1     
  Branches     5656     5655       -1     
==========================================
- Hits        25781    25780       -1     
  Misses      14031    14031              
  Partials     1013     1013              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@effigies effigies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Small cleanup to avoid escaping quotes.

nipype/interfaces/utility/tests/test_csv.py Outdated Show resolved Hide resolved
@effigies effigies merged commit 58d4fc7 into nipy:master Mar 17, 2024
7 of 8 checks passed
@zachlindsey zachlindsey deleted the improve_csv_reader_quote_handling_and_separators branch March 20, 2024 19:04
@effigies effigies mentioned this pull request Mar 20, 2024
6 tasks
@effigies effigies mentioned this pull request Oct 31, 2024
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSVReader does not handle quoted fields or tsv files
2 participants