Skip to content

Commit

Permalink
Prevent unset cli options from overriding defaults (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
aantn authored Jun 23, 2024
1 parent a96123a commit 045bd35
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion holmes/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ def load_from_file(cls, config_file: Optional[str], **kwargs) -> "Config":
logging.debug("No config file found, using cli settings only")
config_from_file = None

config_from_cli = cls(**kwargs)
cli_options = {
k: v for k, v in kwargs.items() if v is not None and v != []
}
config_from_cli = cls(**cli_options)
if config_from_file is None:
return config_from_cli

Expand Down

0 comments on commit 045bd35

Please sign in to comment.