11from collections import OrderedDict
22import pickle
33import time
4- from typing import Any , IO , Optional , TextIO , TYPE_CHECKING # noqa: F401
4+ from typing import Any , IO , TextIO
55import os
66
77import arff
1313from ..exceptions import PyOpenMLError
1414from ..flows import get_flow
1515from ..tasks import get_task , TaskTypeEnum
16+ from ..utils import _tag_entity
1617
1718
1819class OpenMLRun (object ):
@@ -468,8 +469,7 @@ def push_tag(self, tag):
468469 tag : str
469470 Tag to attach to the run.
470471 """
471- data = {'run_id' : self .run_id , 'tag' : tag }
472- openml ._api_calls ._perform_api_call ("/run/tag" , 'post' , data = data )
472+ _tag_entity ('run' , self .run_id , tag )
473473
474474 def remove_tag (self , tag ):
475475 """Removes a tag from this run on the server.
@@ -479,8 +479,7 @@ def remove_tag(self, tag):
479479 tag : str
480480 Tag to attach to the run.
481481 """
482- data = {'run_id' : self .run_id , 'tag' : tag }
483- openml ._api_calls ._perform_api_call ("/run/untag" , 'post' , data = data )
482+ _tag_entity ('run' , self .run_id , tag , untag = True )
484483
485484
486485###############################################################################
0 commit comments