You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2023/03/04 01:19:40 UTC

[superset] 01/01: fix(migration): Address issue in #23228

This is an automated email from the ASF dual-hosted git repository.

johnbodley pushed a commit to branch john-bodley--fix-23228
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 79dfd5982e6b0133c7cbf511c037fe252c43be1f
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Sat Mar 4 14:19:31 2023 +1300

    fix(migration): Address issue in #23228
---
 ...23-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/superset/migrations/versions/2023-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py b/superset/migrations/versions/2023-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py
index 86eda9c007..96153a1c2f 100644
--- a/superset/migrations/versions/2023-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py
+++ b/superset/migrations/versions/2023-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py
@@ -28,10 +28,19 @@ down_revision = "f3c2d8ec8595"
 
 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():
@@ -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