File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -38,8 +38,6 @@ def _format_cf(config: Config) -> str:
3838 stream = io .StringIO ()
3939 for key , value in config .items ():
4040 match key :
41- case "secrets" :
42- continue
4341 case "streams" :
4442 for rt in value :
4543 for k , v in rt .items ():
@@ -103,7 +101,8 @@ def load_config(
103101 * overwrites : Path | dict | Config ,
104102) -> Config :
105103 """
106- Merge config information from multiple sources into one run_config.
104+ Merge config information from multiple sources into one run_config. Anything in the
105+ private configs "secrets" section will be discarted.
107106
108107 Args:
109108 private_home: Configuration file containing platform dependent information and secretes
@@ -211,6 +210,7 @@ def _load_private_conf(private_home: Path | None) -> DictConfig:
211210 private_cf ["model_path" ] = (
212211 private_cf ["model_path" ] if "model_path" in private_cf .keys () else "./models"
213212 )
213+ del private_cf ["secrets" ]
214214 return private_cf
215215
216216
Original file line number Diff line number Diff line change @@ -150,7 +150,9 @@ def config_fresh(private_config_file):
150150
151151
152152def test_contains_private (config_fresh ):
153- assert contains_keys (config_fresh , DUMMY_PRIVATE_CONF )
153+ sanitized_private_conf = DUMMY_PRIVATE_CONF .copy ()
154+ del sanitized_private_conf ["secrets" ]
155+ assert contains_keys (config_fresh , sanitized_private_conf )
154156
155157
156158@pytest .mark .parametrize ("overwrite_dict" , DUMMY_OVERWRITES , indirect = True )
@@ -207,9 +209,8 @@ def test_from_cli(options, cf):
207209
208210def test_print_cf_no_secrets (config_fresh ):
209211 output = config ._format_cf (config_fresh )
210- print (output )
211212
212- assert "53CR3T" not in output
213+ assert "53CR3T" not in output and "secrets" not in config_fresh . keys ()
213214
214215
215216@pytest .mark .parametrize ("streams_dir" , VALID_STREAMS , indirect = True )
You can’t perform that action at this time.
0 commit comments