config
config copied to clipboard
Dots args to get()
I'm not sure if this is a good idea, but I'll throw it out here: What if config::get()
could take named dots arguments and evaluate them in !expr
expressions in config.yml files? This would provide a useful way to add context dependence to configuration without using environment variables.
A practical example: sparklyr::spark_connect()
calls sparklyr::spark_config()
which in turn calls config::get()
. Say you wanted to specify Spark configuration parameters in config.yml, but make them dependent on the master
argument to spark_connect()
. If the master
argument was passed through in the dots to config::get()
, then you could have a config.yml file like this:
default:
some.setting: !expr ifelse(master == "local", "foo", "bar")
I'm we're only responding now, but I'm doing some cleanup of old issues.
IIUC, you're suggesting to be able to evaluate expressions in the config file. This is now possible, so I suggest closing this issue.
If I misunderstand, please add some additional context about how you would call config::get()
using these "dots arguments".
The idea is that you would call config::get(value = "some.setting", master = TRUE)
. Since master
is not one of the formal arguments to config::get()
, it would be interpreted as one of the ...
(dots) arguments, and its specified value "local"
would then be used to evaluate the expression.