Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing one required positional argument experiment_ids when exporting MLflow experiments. #169

Open
sergey-serebryakov opened this issue Feb 5, 2024 · 1 comment

Comments

@sergey-serebryakov
Copy link

sergey-serebryakov commented Feb 5, 2024

Problem description

I just tried to export MLflow experiment from my local MLflow server and got TypeError exception. The stack trace is the following:

Traceback (most recent call last):
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/bin/export-experiment", line 8, in <module>
    sys.exit(main())
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/mlflow_export_import/experiment/export_experiment.py", line 147, in main
    export_experiment(
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/mlflow_export_import/experiment/export_experiment.py", line 76, in export_experiment
    for j,run in enumerate(SearchRunsIterator(mlflow_client, exp.experiment_id, **kwargs)):
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/mlflow_export_import/common/iterators.py", line 26, in __iter__
    self.paged_list = self._call_iter()
  File "/home/serebrya/anaconda3/envs/mlflow-export-import/lib/python3.10/site-packages/mlflow_export_import/common/iterators.py", line 18, in _call_iter
    return self.search_method(filter_string=self.filter)  #7623 - https://mlflow.org/docs/2.1.1/python_api/mlflow.client.html
TypeError: MlflowClient.search_runs() missing 1 required positional argument: 'experiment_ids'

MLflow Export-Import installation

I installed MLflow export-import by following information in the README file (latest commit at this time is a4e7948):

conda create -n mlflow-export-import python=3.10
conda activate mlflow-export-import
pip install git+https:///github.com/mlflow/mlflow-export-import/#egg=mlflow-export-import

What might be causing this error

I looked at the source code. The export_experiment function creates a new SearchRunsIterator instance that assigns search_method class variable to be MLflowClient.search_runs method. The _call_iter method then calls search_runs without providing experiment_ids parameter that is mandatory according to MLflow documentation.

  • Update 01: it's probably the same as Mlflow version check not working #167 for modern versions of MLflow. I am still not certain why experiment_ids is not used for earlier versions of MLflow since it seems to be required, e.g., 2.0.1.
  • Update 02: installing pip install git+https://github.com/lsc64/mlflow-export-import@patch-1 fixes this.
@lsc64
Copy link

lsc64 commented Feb 7, 2024

Yeah, this is exactly what made me aware of #167. Glad the patch worked for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants