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


##########
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:
   I would suggest also putting a log into line 60 above in case that's where 
the failure is. 



-- 
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