diff --git a/mlrun/db/httpdb.py b/mlrun/db/httpdb.py index fd4e48b8379..e9616f38e3c 100644 --- a/mlrun/db/httpdb.py +++ b/mlrun/db/httpdb.py @@ -794,7 +794,7 @@ def list_runs( :param labels: A list of labels to filter by. Label filters work by either filtering a specific value of a label (i.e. list("key=value")) or by looking for the existence of a given key (i.e. "key"). - :param state: List only runs whose state is specified. + :param state: Deprecated - List only runs whose state is specified (will be removed in 1.9.0) :param states: List only runs whose state is one of the provided states. :param sort: Whether to sort the result according to their start time. Otherwise, results will be returned by their internal order in the DB (order will not be guaranteed). @@ -831,6 +831,13 @@ def list_runs( FutureWarning, ) + if state: + # TODO: Remove this in 1.9.0 + warnings.warn( + "'state' is deprecated and will be removed in 1.9.0. Use 'states' instead.", + FutureWarning, + ) + if ( not name and not uid diff --git a/mlrun/projects/project.py b/mlrun/projects/project.py index a4baea68823..1f792e6ee92 100644 --- a/mlrun/projects/project.py +++ b/mlrun/projects/project.py @@ -3727,11 +3727,11 @@ def list_runs( :param labels: A list of labels to filter by. Label filters work by either filtering a specific value of a label (i.e. list("key=value")) or by looking for the existence of a given key (i.e. "key"). - :param state: List only runs whose state is specified. + :param state: Deprecated - List only runs whose state is specified. :param states: List only runs whose state is one of the provided states. :param sort: Whether to sort the result according to their start time. Otherwise, results will be returned by their internal order in the DB (order will not be guaranteed). - :param last: Deprecated - currently not used (will be removed in 1.8.0). + :param last: Deprecated - currently not used (will be removed in 1.9.0). :param iter: If ``True`` return runs from all iterations. Otherwise, return only runs whose ``iter`` is 0. :param start_time_from: Filter by run start time in ``[start_time_from, start_time_to]``. :param start_time_to: Filter by run start time in ``[start_time_from, start_time_to]``. @@ -3739,6 +3739,13 @@ def list_runs( last_update_time_to)``. :param last_update_time_to: Filter by run last update time in ``(last_update_time_from, last_update_time_to)``. """ + if state: + # TODO: Remove this in 1.9.0 + warnings.warn( + "'state' is deprecated and will be removed in 1.9.0. Use 'states' instead.", + FutureWarning, + ) + db = mlrun.db.get_run_db(secrets=self._secrets) return db.list_runs( name,