Skip to content

Commit

Permalink
fix: properly handle tagged storage if only default settings are prov…
Browse files Browse the repository at this point in the history
…ided
  • Loading branch information
johanneskoester committed Jan 23, 2024
1 parent d233f4f commit f59aa18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snakemake_interface_common/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ def _get_spec(cls, exc):

class InvalidPluginException(ApiError):
def __init__(self, plugin_name: str, message: str):
super().__init__(f"Snakemake plugin {plugin_name} is invalid: {message}")
super().__init__(f"Error loading Snakemake plugin {plugin_name}: {message}")
6 changes: 5 additions & 1 deletion snakemake_interface_common/plugin_registry/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def register_settings(self, settings: SettingsBase, tag: Optional[str] = None):
self._inner[tag] = settings

def get_settings(self, tag: Optional[str] = None) -> Optional[SettingsBase]:
return self._inner.get(tag)
settings = self._inner.get(tag)
if tag is not None and settings is None:
# no settings specifically for this tag, just use untagged defaults
settings = self._inner.get(None)
return settings

def get_field_settings(self, field_name: str) -> Dict[str, Sequence[Any]]:
"""Return a dictionary of tag -> value for the given field name."""
Expand Down

0 comments on commit f59aa18

Please sign in to comment.