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/non atomic values #108

Merged
merged 5 commits into from
Mar 4, 2022
Merged

Fix/non atomic values #108

merged 5 commits into from
Mar 4, 2022

Conversation

kylebaron
Copy link
Contributor

Summary

Basically, when values are coded like this:

values: [ male: 1, female: 2]

yaml returns a list of lists; the correct coding is

values: {male: 1, female: 2}

This PR implements a check for values to make sure they are atomic and generates an error when not.

@kylebaron kylebaron linked an issue Jan 21, 2022 that may be closed by this pull request
@kylebaron kylebaron requested a review from andersone1 January 21, 2022 04:44
@kylebaron kylebaron merged commit 4713bf4 into develop Mar 4, 2022
@kylebaron kylebaron deleted the fix/non-atomic-values branch March 4, 2022 16:04
@kylebaron kylebaron mentioned this pull request Mar 16, 2022
2 tasks
kyleam added a commit to metrumresearchgroup/pmforest that referenced this pull request Mar 18, 2022
yspec 0.5.2 now errors for miscoded values.  From its NEWS:

    ys_load() will now detect if values / decode are mis-coded as a
    list of lists; all items in values and decode must be atomic

This leads to two pmforest test failures with errors like this:

    Error (test-base-plot.R:6:1): (code run outside of `test_that()`)
    Error: invalid column data
    In file: analysis3.yml
     column: BLQ
       - values field includes non-atomic data ...
       - yaml code possibly used brackets [ ] when braces { } were
       intended

    [...]
     7. yspec:::.stop("invalid ", context, " data\n", file, "\n", err)
          at yspec/R/load_spec.R:139:2

Adjust the BLQ value to have the correct coding (see
<metrumresearchgroup/yspec#108>).
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.

Mis-coded values field is not being detected
2 participants