Skip to content

Commit

Permalink
fix: Viz migration adjustments - 2 (apache#24429)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-s-molina authored Jun 20, 2023
1 parent c3b5d72 commit fdef9cb
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions superset/migrations/shared/migrate_viz/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
from typing import Any

from .base import MigrateViz


class MigrateTreeMap(MigrateViz):
source_viz_type = "treemap"
target_viz_type = "treemap_v2"
remove_keys = {"metrics"}
rename_keys = {"order_desc": "sort_by_metric"}

def _pre_action(self) -> None:
if (
Expand Down Expand Up @@ -105,3 +108,7 @@ def _pre_action(self) -> None:
self.data["truncateYAxis"] = True
self.data["metrics"] = [self.data.get("metric")]
self.data["metrics_b"] = [self.data.get("metric_2")]

def _migrate_temporal_filter(self, rv_data: dict[str, Any]) -> None:
super()._migrate_temporal_filter(rv_data)
rv_data["adhoc_filters_b"] = rv_data.get("adhoc_filters") or []

0 comments on commit fdef9cb

Please sign in to comment.