Repository: mlflow/mlflow

Issue:
get_metric_history does not work
This calling code https://github.com/mlflow/mlflow/blob/aef0936a4bbc3e56519e3c64bb60701f0114095c/mlflow/tracking/_tracking_service/client.py#L88 expects a dict of the token and the list while the called function just gives the pure list, so line 94 will always fail.

Discussion:
mlflow-automation: 
<!-- documentation preview -->

Documentation preview for f9fb48db5f120920e21a8607949f7d520f2a102a will be available [here](https://output.circle-artifacts.com/output/job/9c47ebe4-840b-49e6-898f-646c5e32b686/artifacts/0/docs/build/html/index.html) when [this CircleCI job](https://circleci.com/gh/mlflow/mlflow/39251) completes successfully.

<details>
<summary>More info</summary>

- Ignore this comment if this PR does not change the documentation.
- It takes a few minutes for the preview to be available.
- The preview is updated when a new commit is pushed to this PR.
- This comment was created by https://github.com/mlflow/mlflow/actions/runs/3853230915.

</details>


Patch:
diff --git a/mlflow/store/tracking/file_store.py b/mlflow/store/tracking/file_store.py
index a3009b073..b41ba6230 100644
--- a/mlflow/store/tracking/file_store.py
+++ b/mlflow/store/tracking/file_store.py
@@ -773,7 +773,7 @@ class FileStore(AbstractStore):
 
         parent_path, metric_files = self._get_run_files(run_info, "metric")
         if metric_key not in metric_files:
-            return []
+            return PagedList([], None)
         return PagedList(
             [
                 FileStore._get_metric_from_line(metric_key, line)


Test patch:
diff --git a/tests/store/tracking/test_file_store.py b/tests/store/tracking/test_file_store.py
index 709ae18ad..660655e94 100644
--- a/tests/store/tracking/test_file_store.py
+++ b/tests/store/tracking/test_file_store.py
@@ -23,6 +23,7 @@ from mlflow.entities import (
     RunData,
     ExperimentTag,
 )
+from mlflow.store.entities.paged_list import PagedList
 from mlflow.exceptions import MlflowException, MissingConfigException
 from mlflow.store.tracking import SEARCH_MAX_RESULTS_DEFAULT
 from mlflow.store.tracking.file_store import FileStore
@@ -1787,4 +1788,5 @@ class TestFileStore(unittest.TestCase, AbstractStoreTest):
         run = self._create_run(file_store)
         run_id = run.info.run_id
         test_metrics = file_store.get_metric_history(run_id, "test_metric")
+        assert isinstance(test_metrics, PagedList)
         assert test_metrics == []