Skip to contents

Get hub config schema versions

Usage

get_version_config(config)

get_version_file(config_path)

get_version_hub(hub_path, config_type = c("tasks", "admin"))

Arguments

config

A <config> class object. Usually the output of read_config or read_config_file.

config_path

Character string. Path to JSON config file.

hub_path

Either a character string path to a local Modeling Hub directory or an object of class <SubTreeFileSystem> created using functions arrow::s3_bucket() or arrow::gs_bucket() by providing a string S3 or GCS bucket name or path to a Modeling Hub directory stored in the cloud. For more details consult the Using cloud storage (S3, GCS) in the arrow package.

config_type

Character vector specifying the type of config file to read. One of "tasks" or "admin". Default is "tasks".

Value

The schema version number as a character string.

Functions

  • get_version_config(): Get schema version from config list representation.

  • get_version_file(): Get schema version from config file at specific path.

  • get_version_hub(): Get schema version from config file at specific path.

Examples

config <- read_config_file(
  system.file("config", "tasks.json", package = "hubUtils")
)
get_version_config(config)
#> [1] "v3.0.0"
config_path <- system.file("config", "tasks.json", package = "hubUtils")
get_version_file(config_path)
#> [1] "v3.0.0"
hub_path <- system.file("testhubs/simple", package = "hubUtils")
get_version_hub(hub_path)
#> [1] "v2.0.0"
get_version_hub(hub_path, "admin")
#> [1] "v2.0.0"