Skip to content

Commit

Permalink
remove try catch
Browse files Browse the repository at this point in the history
Signed-off-by: harupy <hkawamura0130@gmail.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
  • Loading branch information
harupy committed Jan 11, 2022
1 parent 53ff3ca commit 842381b
Showing 1 changed file with 7 additions and 14 deletions.
Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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():
Expand Down

0 comments on commit 842381b

Please sign in to comment.