Skip to content

Commit

Permalink
Raise error if trying to rename a subset that doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Dec 19, 2024
1 parent d72b874 commit 12da2c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jdaviz/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -2061,6 +2061,10 @@ def _rename_subset(self, old_label, new_label, subset_group=None, check_valid=Tr
if s.label == old_label:
subset_group = s
break
# If we couldn't find a matching subset group, raise an error
else:
raise ValueError(f"No subset named {old_label} to rename")

if check_valid:
if self._check_valid_subset_label(new_label):
subset_group.label = new_label
Expand Down

0 comments on commit 12da2c1

Please sign in to comment.