Skip to content

Commit 7a199c3

Browse files
authored
return empty array instead of filenotfounderror (#64)
1 parent ce0fc08 commit 7a199c3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/data_designer/config/default_model_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def get_default_model_configs() -> list[ModelConfig]:
7575
config_dict = load_config_file(MODEL_CONFIGS_FILE_PATH)
7676
if "model_configs" in config_dict:
7777
return [ModelConfig.model_validate(mc) for mc in config_dict["model_configs"]]
78-
raise FileNotFoundError(f"Default model configs file not found at {str(MODEL_CONFIGS_FILE_PATH)!r}")
78+
return []
7979

8080

8181
def get_default_providers() -> list[ModelProvider]:

tests/config/test_default_model_settings.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ def test_get_default_model_configs_path_exists(tmp_path: Path):
7979

8080
def test_get_default_model_configs_path_does_not_exist():
8181
with patch("data_designer.config.default_model_settings.MODEL_CONFIGS_FILE_PATH", new=Path("non_existent_path")):
82-
with pytest.raises(FileNotFoundError, match=r"Default model configs file not found at 'non_existent_path'"):
83-
get_default_model_configs()
82+
assert get_default_model_configs() == []
8483

8584

8685
def test_get_default_providers_path_exists(tmp_path: Path):

0 commit comments

Comments
 (0)