Skip to content

Commit b71ae0e

Browse files
committed
add deprecated handler warning when loading handler #386
1 parent 736131d commit b71ae0e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

R/initWorkflow.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ initWorkflow <- function(file, dir = ".", jobDirPath = NULL, handleMetadata = TR
276276
x$source, x$handler))
277277

278278
md_dict_handler <- loadMetadataHandler(config, x, type = "dictionary")
279+
if(md_dict_handler$status == "deprecated"){
280+
config$logger.warn(sprintf("Dictionary handler '%s' is deprecated. Notes: %s",
281+
md_dict_handler$id, ifelse(nzchar(md_dict_handler$notes), md_dict_handler$notes, "-")))
282+
}
279283
config$logger.info("Execute handler to load dictionary data structures...")
280284
dict <- md_dict_handler$fun(
281285
handler = md_dict_handler,
@@ -395,6 +399,10 @@ initWorkflow <- function(file, dir = ".", jobDirPath = NULL, handleMetadata = TR
395399
config$logger.info(sprintf("Loading metadata contacts from '%s' [with '%s' handler]...",
396400
x$source, x$handler))
397401
md_contact_handler <- loadMetadataHandler(config, x, type = "contacts")
402+
if(md_contact_handler$status == "deprecated"){
403+
config$logger.warn(sprintf("Contact handler '%s' is deprecated. Notes: %s",
404+
md_contact_handler$id, ifelse(nzchar(md_contact_handler$notes), md_contact_handler$notes, "-")))
405+
}
398406
config$logger.info("Execute contact handler to load contacts...")
399407
contacts <- md_contact_handler$fun(
400408
handler = md_contact_handler,
@@ -434,6 +442,10 @@ initWorkflow <- function(file, dir = ".", jobDirPath = NULL, handleMetadata = TR
434442
config$logger.info(sprintf("Loading metadata entities from '%s' [with '%s' handler]...",
435443
x$source, x$handler))
436444
md_entity_handler <- loadMetadataHandler(config, x, type = "entities")
445+
if(md_entity_handler$status == "deprecated"){
446+
config$logger.warn(sprintf("Entity handler '%s' is deprecated. Notes: %s",
447+
md_entity_handler$id, ifelse(nzchar(md_entity_handler$notes), md_entity_handler$notes, "-")))
448+
}
437449
config$logger.info("Execute handler to load entities...")
438450
entities <- md_entity_handler$fun(
439451
handler = md_entity_handler,

0 commit comments

Comments
 (0)