mlflow / mlflow-export-import

Apache License 2.0
131 stars 77 forks source link

Mlflow version check not working #167

Open dwahdany opened 8 months ago

dwahdany commented 8 months ago

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