Skip to content

Commit

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

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 +55,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 f7e7652

Please sign in to comment.