john-bodley commented on code in PR #23741:
URL: https://github.com/apache/superset/pull/23741#discussion_r1172976631


##########
superset/migrations/versions/2023-04-19_11-23_4c5da39be729_migrate_treemap_chart.py:
##########
@@ -0,0 +1,47 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""migrate_treemap_chart
+
+Revision ID: 4c5da39be729
+Revises: 07f9a902af1b
+Create Date: 2023-04-19 11:23:23.192064
+
+"""
+from alembic import op
+from sqlalchemy.dialects.mysql.base import MySQLDialect
+
+from superset.migrations.shared.migrate_viz import MigrateTreeMap
+
+# revision identifiers, used by Alembic.
+revision = "4c5da39be729"
+down_revision = "07f9a902af1b"
+
+
+def upgrade():
+    # Ensure `slice.params` and `slice.query_context`` in MySQL is MEDIUMTEXT
+    # before migration, as the migration will save a duplicate form_data backup
+    # which may significantly increase the size of these fields.
+    if isinstance(op.get_bind().dialect, MySQLDialect):

Review Comment:
   It would be great (possibly before) to make sure these columns are defined 
as a 
[MediumText](https://github.com/apache/superset/blob/7a6fb86cbbbcc8f782827ba3e7bcb174e068296f/superset/utils/core.py#L1592-L1593)
 in the model and had a corresponding migration so we wouldn't need this logic. 



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