-
Notifications
You must be signed in to change notification settings - Fork 29
csvdelimiter and project csv delimiter not consistently respected in exports and imports #491
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
Conversation
|
Can you add your personal ctb details to the DESCRIPTION file for proper attribution? |
R/redcapConnection.R
Outdated
| csv_delimiter_api <- switch( | ||
| csv_delimiter, | ||
| "," = "comma", | ||
| "\t" = "tab", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
I'm seeing failures in our tests from this PR. |
|
These errors seem unrelated. Has checkmate pushed an update? Update: I tested main. I have the github version of checkmate installed. I reverted to CRAN. These errors are occurring with an unpublished version of checkmate. When they push to CRAN we will need to update our test suite. |
Tests on behavior we depend on are all passing. |
|
Okay, summary:
and this looks good to me. |
|
It's easier than I thought. There's no need to distinguish between |
|
No regression and |

Summary
This PR makes
redcapAPIrobust against non-comma CSV delimiters (e.g. semicolon) by:redcapApiConnection,csvDelimiterconsistently to the API for CSV-based exports,writeDataForImport()delimiter-aware for imports.Details
See issue #1.
High-level changes:
redcapApiConnection: addcsv_delimiter(),set_csv_delimiter(),csv_delimiter_api().exportProjectInformation.redcapApiConnection(),exportDags.redcapApiConnection(),exportRecords*,.exportFieldNamesApiCall(): passcsvDelimiterin the body and parse usingsep = rcon$csv_delimiter().writeDataForImport(): addcsv_delimiterargument (default",") and usewrite.table(..., sep = csv_delimiter, ...).importDags.redcapApiConnection(): callwriteDataForImport(data, csv_delimiter = rcon$csv_delimiter()).Testing
writeDataForImport()produces valid CSV for","and";"delimiters.csvDelimiter/sepconsistently.