Skip to content

Commit

Permalink
fix(sdk): Fix get_experiment when there are no experiments. Fixes kub…
Browse files Browse the repository at this point in the history
…eflow#4176 (kubeflow#4177)

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
  • Loading branch information
elikatsis authored and Jeffwan committed Dec 9, 2020
1 parent 0fc5178 commit 7925d3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sdk/python/kfp/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ def get_experiment(self, experiment_id=None, experiment_name=None, namespace=Non
while next_page_token is not None:
list_experiments_response = self.list_experiments(page_size=100, page_token=next_page_token, namespace=namespace)
next_page_token = list_experiments_response.next_page_token
for experiment in list_experiments_response.experiments:
for experiment in list_experiments_response.experiments or []:
if experiment.name == experiment_name:
return self._experiment_api.get_experiment(id=experiment.id)
raise ValueError('No experiment is found with name {}.'.format(experiment_name))
Expand Down

0 comments on commit 7925d3e

Please sign in to comment.