Skip to content

Commit

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

Signed-off-by: Ilias Katsakioris <elikatsis@arrikto.com>
  • Loading branch information
elikatsis authored Jul 8, 2020
1 parent c6ac83f commit 749538d
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 749538d

Please sign in to comment.