Skip to content

Commit

Permalink
Let SOMADataFrame validate soma_joinid
Browse files Browse the repository at this point in the history
  • Loading branch information
mojaveazure committed Apr 13, 2023
1 parent 078edc2 commit 4f569e2
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions apis/r/R/write_soma.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,7 @@ write_soma.data.frame <- function(
)
}
# Add `soma_joinid` to `x`
if ('soma_joinid' %in% names(x)) {
if (!bit64::is.integer64(x[['soma_joinid']])) {
if (!rlang::is_integerish(x[['soma_joinid']], finite = TRUE) || !all(x[['soma_joinid']] >= 0L)) {
stop(
"Found column 'soma_joinid' in the data frame without positive integers",
call. = FALSE
)
}
x[['soma_joind']] <- bit64::as.integer64(x[['soma_joinid']])
}
} else {
if (!'soma_joinid' %in% names(x)) {
x$soma_joinid <- bit64::seq.integer64(from = 0L, to = nrow(x) - 1L)
}
# Create the SOMADataFrame
Expand Down

0 comments on commit 4f569e2

Please sign in to comment.