Skip to content

Commit

Permalink
fix(pvt2): migrations from legacy pivot table error when form_data ha…
Browse files Browse the repository at this point in the history
…ve pieces of pvt2 (apache#24710)
  • Loading branch information
Always-prog authored Jul 20, 2023
1 parent 91e6f5c commit df106aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions superset/migrations/shared/migrate_viz/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ def _migrate(self) -> None:
if "viz_type" in self.data:
self.data["viz_type"] = self.target_viz_type

# Sometimes visualizations have same keys in the source form_data and rename_keys
# We need to remove them from data to allow the migration to work properly with rename_keys
for source_key, target_key in self.rename_keys.items():
if source_key in self.data and target_key in self.data:
self.data.pop(target_key)

rv_data = {}
for key, value in self.data.items():
if key in self.rename_keys and self.rename_keys[key] in rv_data:
Expand Down

0 comments on commit df106aa

Please sign in to comment.