mlflow-export-import icon indicating copy to clipboard operation
mlflow-export-import copied to clipboard

Mlflow version check not working

Open dwahdany opened this issue 1 year ago • 0 comments

The BaseIterator checks the mlflow version with mlflow.__version__ < "2.2.1" (see code below). This check does not function as intented, since for the latest version (2.10.0) the check is true, as the string comparison "2.10.0" < "2.2.1" passes.

class BaseIterator():
    """
    Base class to iterate for 'search' methods that return PageList.
    """
    def __init__(self, search_method, max_results=None, filter=None):
        self.search_method = search_method
        self.filter = filter
        self.max_results = max_results
        self.idx = 0
        self.paged_list = None
        self.kwargs = { "max_results": self.max_results } if self.max_results else {}

    def _call_iter(self):
        if mlflow.__version__ < "2.2.1":
            return self.search_method(filter_string=self.filter)  #7623 - https://mlflow.org/docs/2.1.1/python_api/mlflow.client.html
        else:
            return self.search_method(filter_string=self.filter, **self.kwargs) # https://mlflow.org/docs/latest/python_api/mlflow.client.html

dwahdany avatar Feb 01 '24 11:02 dwahdany