You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by hu...@apache.org on 2023/04/06 15:28:30 UTC

[superset] 03/03: update table name

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

hugh pushed a commit to branch chart-ds-constraint
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 5afaf6e4323d0858c4c6edabebcd8efd9ad70b43
Author: hughhhh <hu...@gmail.com>
AuthorDate: Thu Apr 6 11:28:02 2023 -0400

    update table name
---
 .../versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py b/superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py
index 3bcb0c3822..e611a197cc 100644
--- a/superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py
+++ b/superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py
@@ -24,9 +24,7 @@ Create Date: 2023-03-27 12:30:01.164594
 
 # revision identifiers, used by Alembic.
 revision = "7e67aecbf3f1"
-down_revision = "b5ea9d343307"
-
-import json
+down_revision = "07f9a902af1b"
 
 import sqlalchemy as sa
 from alembic import op
@@ -48,13 +46,13 @@ class Slice(Base):  # type: ignore
 
 def upgrade():
     bind = op.get_bind()
-    session = db.Session(bind=bind)
+    session = db.session(bind=bind)
     for slc in session.query(Slice).filter(Slice.datasource_type != "table").all():
         # clean up all charts with datasource_type not != table
         slc.datasource_type = "table"
 
     op.create_check_constraint(
-        "ck_chart_datasource", "slice", sa.column("datasource_type") == "table"
+        "ck_chart_datasource", "slices", sa.column("datasource_type") == "table"
     )