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

[188037693]: fix bugs with as.data.frame(ds, force = TRUE) #646

Merged
merged 12 commits into from
Aug 21, 2024

Conversation

gergness
Copy link
Contributor

@gergness gergness commented Jul 30, 2024

Fixes bugs related to as.data.frame(ds, force=TRUE)

  • No longer overwrites the wrong data with the right metadata when there are columns with duplicate aliases (eg two array subvariables with the same alias)
  • Reads text variables with only numbers as character columns (and doesn't overwrite them all with missing)
  • Handles missingness better (text variables have NA instead of string "No Data", sometimes numeric arrays would end up all missing if any were missing)

This PR seems bigger than it is because I've had to rerun the automatic fixture generation code for the first time in a while.

The changes in 0325843 represent only changes to the backend and had no effect on rcrunch behavior. They are only included so that rcrunch's mock tests represent what the server actually sends.

The changes in this commit ed91176 represent the new mock dataset I added which has duplicate subvariable aliases and updates to the csv.

@gergness gergness force-pushed the csv-text-numbers-188037693 branch from eedb96c to 86efb32 Compare August 5, 2024 19:19
@gergness gergness changed the title [188037693]: fix bug when text variable with only numbers is exported… [188037693]: fix bugs with as.data.frame(ds, force = TRUE) Aug 6, 2024
@gergness gergness force-pushed the csv-text-numbers-188037693 branch from 2283999 to 31ef3f2 Compare August 6, 2024 15:48
Copy link

@sluga sluga left a comment

Choose a reason for hiding this comment

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

Maybe you want to update this part? Could probably just refer the reader to the array_strategy argument help.

#' * Array variables (Categorical Array, Multiple Response) are decomposed into
#' their constituent categorical subvariables. An array with three subvariables,
#' for example, will result in three columns in the `data.frame`.
#'
#' Column names in the `data.frame` are the variable/subvariable aliases.

@crunchbot crunchbot merged commit 9489964 into master Aug 21, 2024
6 checks passed
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.

4 participants