-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature/json nullwrite #23
Conversation
@jdblischak if you're good with this I'd like to squash and merge this one. |
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 fine if you squash and merge this PR. However, I left some comments and suggestions for applying na = "null"
globally for all JSON output if that would be desired
@@ -70,7 +70,7 @@ createTextFiles <- function(study, directoryname, calcOverlaps = FALSE) { | |||
dir.create(directoryname, showWarnings = FALSE, recursive = TRUE) | |||
exportSamples(study, directoryname) | |||
exportFeatures(study, directoryname) | |||
exportModels(study, directoryname) | |||
exportModels(study, directoryname, na="null") |
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.
What is the motivation for only wanting to apply this to the "models" output and not other JSON output like "tests" and "annotations"?
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.
Companion tools that need to be updated in sequence. This gives us flexibility with output types, which I need (for now) internally. This change won't impact any external users of OmicNavigator. I anticipate na=null
to become the default argument for write_json
in time.
@@ -65,7 +65,7 @@ readJson <- function(x, simplifyVector = TRUE, ...) { | |||
} | |||
|
|||
writeJson <- function(x, file, auto_unbox = TRUE, pretty = TRUE, ...) { |
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.
If you wanted to apply na = "null"
to all JSON output files, you could treat it the same as other default arguments like auto_unbox
and pretty
. Add na = "null"
to writeJson()
and na = na
to jsonlite::write_json()
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.
yes
na="null" passed to write_json for the export of model metadata.