diff --git a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py index 1f5a9098f40..7978322b27d 100644 --- a/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py +++ b/sdk/python/v1beta1/kubeflow/katib/api/katib_client.py @@ -93,8 +93,9 @@ def create_experiment( namespace = namespace or self.namespace - experiment_name = experiment.metadata.name - if not experiment_name: + if 'name' in experiment.metadata and experiment.metadata.name: + experiment_name = experiment.metadata.name + else: experiment_name = experiment.metadata.generate_name try: