fix(pvt2): migrations from legacy pivot table error when form_data have pieces of pvt2 (#24710)

This commit is contained in:
Stepan 2023-07-20 21:25:51 +03:00 committed by GitHub
parent 91e6f5cb9f
commit df106aa708
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -64,6 +64,12 @@ class MigrateViz:
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: