Skip to content

Commit

Permalink
fix: correct sonar quality checks (#1568)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Jose Leiva Palomo <[email protected]>
  • Loading branch information
AleJo2995 authored Jun 3, 2024
1 parent 7397105 commit 7f93f86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 3 additions & 3 deletions trestle/core/catalog/catalog_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,9 +469,9 @@ def _get_groups_from_group(group: cat.Group) -> Iterator[cat.Group]:
def get_group_info_by_control(self, control_id: str) -> Tuple[str, str, str]:
"""Get the group_id, title, class for this control from the dict."""
return (
self._control_dict[control_id].group_id,
self._control_dict[control_id].group_title,
self._control_dict[control_id].group_class
'' if self._control_dict is None else self._control_dict[control_id].group_id,
'' if self._control_dict is None else self._control_dict[control_id].group_title,
'' if self._control_dict is None else self._control_dict[control_id].group_class
)

def get_control_path(self, control_id: str) -> List[str]:
Expand Down
5 changes: 4 additions & 1 deletion trestle/core/catalog/catalog_merger.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,10 @@ def merge_catalog(self, catalog: cat.Catalog, replace_params: bool) -> None:
self._catalog_interface._control_dict[src.id] = new_control_handle # type: ignore

# now need to cull any controls that are not in the src catalog
handled_ids = set(cat_interface._control_dict.keys())
if cat_interface._control_dict is None:
handled_ids = None
else:
handled_ids = set(cat_interface._control_dict.keys())
orig_ids = set(self._catalog_interface._control_dict.keys())
extra_ids = orig_ids.difference(handled_ids)
for extra_id in sorted(extra_ids):
Expand Down

0 comments on commit 7f93f86

Please sign in to comment.