hughhhh commented on code in PR #23925:
URL: https://github.com/apache/superset/pull/23925#discussion_r1184304838


##########
superset/migrations/versions/2023-03-27_12-30_7e67aecbf3f1_chart_ds_constraint.py:
##########
@@ -63,9 +66,15 @@ def upgrade():
     session = db.Session(bind=bind)
 
     with op.batch_alter_table("slices") as batch_op:
-        for slc in session.query(Slice).filter(Slice.datasource_type == 
"query").all():
-            upgrade_slc(slc)
-            session.add(slc)
+        for slc in session.query(Slice).filter(Slice.datasource_type != 
"table").all():
+            if slc.datasource_type == "query":
+                upgrade_slc(slc)
+                session.add(slc)
+
+            else:
+                logger.warn(
+                    f"unknown value detected for slc.datasource_type: 
{slc.datasource_type}"

Review Comment:
   so that's only going to be updating slices that are "query", i updated the 
session.query to look at all instances that are != table
   
   Just wanted to make a path to log information but still update bad slices 
that have datasource_type = query



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to