Skip to content

Commit

Permalink
feat: checkmate support in metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
averissimo committed Nov 30, 2023
1 parent 7eee740 commit b778b78
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion R/metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,22 @@
#' xportr_order()
#' }
xportr_metadata <- function(.df, metadata, domain = NULL) {
assert(
combine = "or",
check_r6(metadata, "Metacore", null.ok = TRUE),
check_data_frame(metadata, null.ok = TRUE)
)
assert_string(domain, null.ok = TRUE)

## Common section to detect domain from argument or pipes

domain <- get_domain(.df, domain)
if (!is.null(domain)) attr(.df, "_xportr.df_arg_") <- domain

## End of common section
assert_data_frame(.df) # deferred after `enexpr` call

structure(.df, `_xportr.df_metadata_` = metadata)
structure(.df, "_xportr.df_metadata_" = metadata)
}


Expand Down

0 comments on commit b778b78

Please sign in to comment.