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/07 07:04:41 UTC
[superset] branch master updated: fix(migration): Address issue in #23228 (#23276)
This is an automated email from the ASF dual-hosted git repository.
johnbodley pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new f7e7652270 fix(migration): Address issue in #23228 (#23276)
f7e7652270 is described below
commit f7e765227009b9df399a07b215f723d2f9b1710f
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Tue Mar 7 20:04:31 2023 +1300
fix(migration): Address issue in #23228 (#23276)
---
...3-02-28_14-46_c0a3ea245b61_remove_show_native_filters.py | 13 +++++++++++--
1 file changed, 11 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..d1c4197b53 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,20 @@ 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 +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