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/05/04 18:09:23 UTC
[superset] branch chart-ds-constraint-again created (now 53bb6edada)
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a change to branch chart-ds-constraint-again
in repository https://gitbox.apache.org/repos/asf/superset.git
at 53bb6edada ok this should be it
This branch includes the following new commits:
new 53bb6edada ok this should be it
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[superset] 01/01: ok this should be it
Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
hugh pushed a commit to branch chart-ds-constraint-again
in repository https://gitbox.apache.org/repos/asf/superset.git
commit 53bb6edada076f39c0f7682fc41422d7c7d0679c
Author: hughhhh <hu...@gmail.com>
AuthorDate: Thu May 4 14:08:03 2023 -0400
ok this should be it
---
.../versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
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 8d3115acbd..4c6941fe84 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
@@ -84,7 +84,6 @@ def upgrade_slc(slc: Slice) -> None:
def upgrade():
bind = op.get_bind()
session = db.Session(bind=bind)
-
with op.batch_alter_table("slices") as batch_op:
for slc in session.query(Slice).filter(Slice.datasource_type != "table").all():
if slc.datasource_type == "query":
@@ -97,6 +96,10 @@ def upgrade():
slc.datasource_type,
)
+ # need commit the updated values for Slice.datasource_type before creating constraint
+ session.commit()
+
+ with op.batch_alter_table("slices") as batch_op:
batch_op.create_check_constraint(
"ck_chart_datasource", "datasource_type in ('table')"
)