Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mlflow_export_import/common/mlflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def set_experiment(mlflow_client, dbx_client, exp_name, tags=None):
exp = mlflow_client.get_experiment(exp_id)
_logger.info(f"Created experiment '{exp.name}' with location '{exp.artifact_location}'")
except RestException as ex:
if ex.error_code != "RESOURCE_ALREADY_EXISTS":
if ex.error_code not in ("RESOURCE_ALREADY_EXISTS", "ALREADY_EXISTS"):
raise MlflowExportImportException(ex, f"Cannot create experiment '{exp_name}'")
exp = mlflow_client.get_experiment_by_name(exp_name)
_logger.info(f"Using existing experiment '{exp.name}' with location '{exp.artifact_location}'")
Expand Down
2 changes: 1 addition & 1 deletion mlflow_export_import/common/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def create_model(client, model_name, model_dct, import_metadata):
_logger.info(f"Created new registered model '{model_name}'")
return True
except RestException as e:
if e.error_code != "RESOURCE_ALREADY_EXISTS":
if e.error_code not in ("RESOURCE_ALREADY_EXISTS", "ALREADY_EXISTS"):
raise e
_logger.info(f"Registered model '{model_name}' already exists")
return False
Expand Down
4 changes: 2 additions & 2 deletions mlflow_export_import/copy/copy_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create_registered_model(client, model_name):
client.create_registered_model(model_name)
return False
except MlflowException as e: # NOTE: for non-UC is RestException
if e.error_code != "RESOURCE_ALREADY_EXISTS":
if e.error_code not in ("RESOURCE_ALREADY_EXISTS", "ALREADY_EXISTS"):
raise
return True

Expand All @@ -28,7 +28,7 @@ def create_experiment(client, experiment_name):
try:
return client.create_experiment(experiment_name)
except MlflowException as e:
if e.error_code != "RESOURCE_ALREADY_EXISTS":
if e.error_code not in ("RESOURCE_ALREADY_EXISTS", "ALREADY_EXISTS"):
raise
experiment = client.get_experiment_by_name(experiment_name)
return experiment.experiment_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def import_evaluation_dataset(
except Exception as e:
error_msg = str(e)
# Check if it's a duplicate name error - this is a fallback in case search didn't catch it
if "already exists" in error_msg.lower() or "duplicate" in error_msg.lower() or "RESOURCE_ALREADY_EXISTS" in error_msg:
if "already exists" in error_msg.lower() or "duplicate" in error_msg.lower() or "ALREADY_EXISTS" in error_msg:
_logger.warning(
f"Evaluation dataset '{final_dataset_name}' already exists - skipping import. "
f"Use --delete-evaluation-dataset to replace."
Expand Down
2 changes: 1 addition & 1 deletion mlflow_export_import/prompt/import_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def import_prompt(
except Exception as e:
error_msg = str(e)
# Check if it's a duplicate error - skip to preserve version numbers
if "already exists" in error_msg.lower() or "duplicate" in error_msg.lower() or "RESOURCE_ALREADY_EXISTS" in error_msg:
if "already exists" in error_msg.lower() or "duplicate" in error_msg.lower() or "ALREADY_EXISTS" in error_msg:
_logger.warning(
f"Prompt '{final_prompt_name}' already exists - skipping import "
f"to preserve version numbers. Use --delete-prompt to replace."
Expand Down