File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -261,10 +261,18 @@ cdmSample <- function(cdm,
261261cdmSubset <- function (cdm , personId ) {
262262
263263 checkmate :: assertClass(cdm , " cdm_reference" )
264- checkmate :: assertIntegerish(personId ,
265- min.len = 1 ,
266- max.len = 1e6 ,
267- null.ok = FALSE )
264+
265+ if (! methods :: is(personId , " integer64" )) {
266+ checkmate :: assertIntegerish(personId ,
267+ min.len = 1 ,
268+ max.len = 1e6 ,
269+ null.ok = FALSE )
270+
271+ personId <- as.integer(personId )
272+ } else {
273+ stopifnot(all(! is.na(personId )), length(personId ) > = 1 )
274+ }
275+
268276
269277 writeSchema <- cdmWriteSchema(cdm )
270278 if (is.null(writeSchema )) rlang :: abort(" write_schema is required for subsetting a cdm!" )
@@ -273,7 +281,7 @@ cdmSubset <- function(cdm, personId) {
273281 prefix <- unique_prefix()
274282 DBI :: dbWriteTable(con ,
275283 name = .inSchema(writeSchema , glue :: glue(" temp{prefix}_" ), dbms(con )),
276- value = data.frame (person_id = as.integer( personId ) ),
284+ value = data.frame (person_id = personId ),
277285 overwrite = TRUE )
278286
279287 # Note temporary = TRUE in dbWriteTable does not work on all dbms but we want a temp table here.
You can’t perform that action at this time.
0 commit comments