Skip to content

Commit ed35e69

Browse files
committed
taggin exception
1 parent 98616db commit ed35e69

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

openml/datasets/dataset.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,9 @@ def push_tag(self, tag: str) -> None:
976976
Tag to attach to the dataset.
977977
"""
978978
if self.dataset_id is None:
979-
raise ValueError(
980-
"Dataset does not have an ID. Please publish the dataset before tagging."
979+
raise openml.exceptions.ObjectNotPublishedError(
980+
"Cannot tag an dataset that has not been published yet."
981+
"Please publish the object first before being able to tag it."
981982
)
982983
openml._backend.dataset.tag(self.dataset_id, tag)
983984

@@ -990,8 +991,9 @@ def remove_tag(self, tag: str) -> None:
990991
Tag to remove from the dataset.
991992
"""
992993
if self.dataset_id is None:
993-
raise ValueError(
994-
"Dataset does not have an ID. Please publish the dataset before untagging."
994+
raise openml.exceptions.ObjectNotPublishedError(
995+
"Cannot tag an dataset that has not been published yet."
996+
"Please publish the object first before being able to tag it."
995997
)
996998
openml._backend.dataset.untag(self.dataset_id, tag)
997999

0 commit comments

Comments
 (0)