From f1a4943c3615fe2e0a0d4515eafbad35f3a44bfc Mon Sep 17 00:00:00 2001 From: harupy Date: Tue, 11 Jan 2022 15:17:25 +0900 Subject: [PATCH] remove try catch Signed-off-by: harupy --- ...pdate_run_status_constraint_with_killed.py | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/mlflow/store/db_migrations/versions/cfd24bdc0731_update_run_status_constraint_with_killed.py b/mlflow/store/db_migrations/versions/cfd24bdc0731_update_run_status_constraint_with_killed.py index 3d821c2b1a4a1..30515995b1bc3 100644 --- a/mlflow/store/db_migrations/versions/cfd24bdc0731_update_run_status_constraint_with_killed.py +++ b/mlflow/store/db_migrations/versions/cfd24bdc0731_update_run_status_constraint_with_killed.py @@ -5,8 +5,6 @@ Create Date: 2019-10-11 15:55:10.853449 """ -import logging - import alembic from alembic import op from mlflow.entities import RunStatus, ViewType @@ -15,8 +13,6 @@ from sqlalchemy import CheckConstraint, Enum from packaging.version import Version -_logger = logging.getLogger(__name__) - # revision identifiers, used by Alembic. revision = "cfd24bdc0731" down_revision = "2b4d017a5e9b" @@ -61,16 +57,13 @@ def upgrade(): existing_type = Enum( *old_run_statuses, create_constraint=True, native_enum=False, name="status" ) - try: - batch_op.alter_column( - "status", - type_=new_type, - # In alembic >= 1.7.0, `existing_type` is required to drop the existing CHECK - # constraint on the status column. - existing_type=existing_type, - ) - except Exception: - _logger.exception("Encountered unexpected error while aletering status column") + batch_op.alter_column( + "status", + type_=new_type, + # In alembic >= 1.7.0, `existing_type` is required to drop the existing CHECK + # constraint on the status column. + existing_type=existing_type, + ) def downgrade():