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

allow empty data list #403

Merged
merged 4 commits into from
Dec 14, 2020
Merged

allow empty data list #403

merged 4 commits into from
Dec 14, 2020

Conversation

jgabry
Copy link
Member

@jgabry jgabry commented Dec 14, 2020

fixes #401

Submission Checklist

  • Run unit tests
  • Declare copyright holder and agree to license (see below)

Summary

If model doesn't require data, allow the user to pass in an empty list of data. Previously the user had to leave data as NULL or pass in non-empty list.

Copyright and Licensing

Please list the copyright holder for the work you are submitting
(this will be you or your assignee, such as a university or company):
Columbia University

By submitting this pull request, the copyright holder is agreeing to
license the submitted work under the following licenses:

Copy link
Member

@rok-cesnovar rok-cesnovar left a comment

Choose a reason for hiding this comment

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

Looks good!

Maybe a test like

expect_null(process_data(list()))

but not necessary.

@jgabry
Copy link
Member Author

jgabry commented Dec 14, 2020

expect_null(process_data(list()))

Yeah I'll add that, good call.

@codecov-io
Copy link

Codecov Report

Merging #403 (cd5a74b) into master (a42f9ab) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #403   +/-   ##
=======================================
  Coverage   88.48%   88.48%           
=======================================
  Files          12       12           
  Lines        2752     2754    +2     
=======================================
+ Hits         2435     2437    +2     
  Misses        317      317           
Impacted Files Coverage Δ
R/data.R 97.60% <100.00%> (+0.03%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a42f9ab...cd5a74b. Read the comment docs.

@jgabry
Copy link
Member Author

jgabry commented Dec 14, 2020

All checks are passing so I'll go ahead and merge

@jgabry jgabry merged commit 1bfe54e into master Dec 14, 2020
@jgabry jgabry deleted the empty-data-list branch December 14, 2020 20:13
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.

data = list() causes expecting JSON error
3 participants