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 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!exprexpressions 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()callssparklyr::spark_config()which in turn callsconfig::get(). Say you wanted to specify Spark configuration parameters in config.yml, but make them dependent on themasterargument tospark_connect(). If themasterargument was passed through in the dots toconfig::get(), then you could have a config.yml file like this: