Skip to content

Handle EmptyData error from pandas read_csv#118

Merged
pwildenhain merged 1 commit intoredcap-tools:masterfrom
martinburchell:handle-read-csv-empty-data-error
May 17, 2020
Merged

Handle EmptyData error from pandas read_csv#118
pwildenhain merged 1 commit intoredcap-tools:masterfrom
martinburchell:handle-read-csv-empty-data-error

Conversation

@martinburchell
Copy link
Copy Markdown
Contributor

pandas read_csv will throw an EmptyDataError if given empty data (no columns and no rows).

This is possible when exporting records for a brand new REDCap project with no records. This change handles the error and returns an empty data frame for all calls to read_csv.

Copy link
Copy Markdown
Collaborator

@pwildenhain pwildenhain left a comment

Choose a reason for hiding this comment

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

Ah much cleaner approach to wrap the function, and get rid of the various imports around the code. Well done 🙇‍♂️

@pwildenhain pwildenhain merged commit ff0e8c6 into redcap-tools:master May 17, 2020
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.

2 participants