Skip to content

Commit

Permalink
fix(migration): Address issue in #23228
Browse files Browse the repository at this point in the history
  • Loading branch information
john-bodley authored Mar 4, 2023
1 parent 006f3dd commit 79dfd59
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@

import json

import sqlalchemy as sa
from alembic import op
from sqlalchemy.ext.declarative import declarative_base

from superset import db
from superset.models.dashboard import Dashboard

Base = declarative_base()


class Dashboard(Base):
__tablename__ = "dashboards"
id = sa.Column(sa.Integer, primary_key=True)
json_metadata = sa.Column(sa.Text)


def upgrade():
Expand All @@ -45,7 +54,6 @@ def upgrade():
if "show_native_filters" in json_metadata:
del json_metadata["show_native_filters"]
dashboard.json_metadata = json.dumps(json_metadata)
session.merge(dashboard)
except Exception: # pylint: disable=broad-except
pass

Expand Down

0 comments on commit 79dfd59

Please sign in to comment.